Coverage Report - org.kuali.rice.kim.bo.entity.dto.KimEntityDefaultInfo
 
Classes in this File Line Coverage Branch Coverage Complexity
KimEntityDefaultInfo
0%
0/40
0%
0/18
1.45
 
 1  
 /*
 2  
  * Copyright 2008-2009 The Kuali Foundation
 3  
  *
 4  
  * Licensed under the Educational Community License, Version 2.0 (the "License");
 5  
  * you may not use this file except in compliance with the License.
 6  
  * You may obtain a copy of the License at
 7  
  *
 8  
  * http://www.opensource.org/licenses/ecl2.php
 9  
  *
 10  
  * Unless required by applicable law or agreed to in writing, software
 11  
  * distributed under the License is distributed on an "AS IS" BASIS,
 12  
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 13  
  * See the License for the specific language governing permissions and
 14  
  * limitations under the License.
 15  
  */
 16  
 package org.kuali.rice.kim.bo.entity.dto;
 17  
 
 18  
 import org.kuali.rice.kim.api.identity.affiliation.EntityAffiliation;
 19  
 import org.kuali.rice.kim.api.identity.name.EntityName;
 20  
 import org.kuali.rice.kim.api.identity.principal.Principal;
 21  
 import org.kuali.rice.kim.api.identity.privacy.EntityPrivacyPreferences;
 22  
 import org.kuali.rice.kim.api.identity.type.EntityTypeDataDefault;
 23  
 import org.kuali.rice.kim.bo.entity.KimEntityEmploymentInformation;
 24  
 
 25  
 import java.util.ArrayList;
 26  
 import java.util.List;
 27  
 
 28  
 /**
 29  
  * default information for a KIM identity
 30  
  * 
 31  
  * @author Kuali Rice Team (rice.collab@kuali.org)
 32  
  * 
 33  
  */
 34  0
 public class KimEntityDefaultInfo extends KimInactivatableInfo {
 35  
 
 36  
     private static final long serialVersionUID = 7930630152792502380L;
 37  
     protected String entityId;
 38  
     protected EntityName defaultName;
 39  
     protected List<Principal> principals;
 40  
     protected List<EntityTypeDataDefault> entityTypes;
 41  
     protected List<EntityAffiliation> affiliations;
 42  
     protected EntityAffiliation defaultAffiliation;
 43  
     protected KimEntityEmploymentInformationInfo primaryEmployment;
 44  
     protected List<KimEntityExternalIdentifierInfo> externalIdentifiers;
 45  
     protected EntityPrivacyPreferences privacyPreferences;
 46  
 
 47  
     /**
 48  
      * Gets this {@link KimEntityDefaultInfo}'s identity id.
 49  
      * @return the identity id for this {@link KimEntityDefaultInfo}, or null if none has been assigned.
 50  
      */
 51  
     public String getEntityId() {
 52  0
         return this.entityId;
 53  
     }
 54  
 
 55  
     public void setEntityId(String entityId) {
 56  0
         this.entityId = entityId;
 57  0
     }
 58  
 
 59  
     /**
 60  
      * Gets this {@link KimEntityDefaultInfo}'s default name.
 61  
      * @return the default name for this {@link KimEntityDefaultInfo}, or null if none has been assigned.
 62  
      */
 63  
     public EntityName getDefaultName() {
 64  0
         return defaultName;
 65  
     }
 66  
 
 67  
     public void setDefaultName(EntityName defaultName) {
 68  0
         this.defaultName = defaultName;
 69  0
     }
 70  
 
 71  
     /**
 72  
      * Gets this {@link KimEntityDefaultInfo}'s List of {@link KimEntityEntityTypeDefaultInfo}S.
 73  
      * @return the List of {@link KimEntityEntityTypeDefaultInfo}S for this {@link KimEntityDefaultInfo}.
 74  
      * The returned List will never be null, an empty List will be assigned and returned if needed. 
 75  
      */
 76  
     public List<EntityTypeDataDefault> getEntityTypes() {
 77  
         // If our reference is null, assign and return an empty List
 78  0
         return (entityTypes != null) ? entityTypes : (entityTypes = new ArrayList<EntityTypeDataDefault>());
 79  
     }
 80  
 
 81  
     public void setEntityTypes(List<EntityTypeDataDefault> entityTypes) {
 82  0
         this.entityTypes = entityTypes;
 83  0
     }
 84  
 
 85  
     /**
 86  
      * Gets this {@link KimEntityDefaultInfo}'s List of {@link EntityAffiliation}S.
 87  
      * @return the List of {@link EntityAffiliation}S for this {@link KimEntityDefaultInfo}.
 88  
      * The returned List will never be null, an empty List will be assigned and returned if needed. 
 89  
      */
 90  
     public List<EntityAffiliation> getAffiliations() {
 91  
         // If our reference is null, assign and return an empty List
 92  0
         return (affiliations != null) ? affiliations : (affiliations = new ArrayList<EntityAffiliation>());
 93  
     }
 94  
 
 95  
     public void setAffiliations(List<EntityAffiliation> affiliations) {
 96  0
         this.affiliations = affiliations;
 97  0
     }
 98  
 
 99  
     /**
 100  
      * Gets this {@link KimEntityDefaultInfo}'s affiliation info.
 101  
      * @return the affiliation info for this {@link KimEntityDefaultInfo}, or null if none has been assigned.
 102  
      */
 103  
     public EntityAffiliation getDefaultAffiliation() {
 104  0
         return defaultAffiliation;
 105  
     }
 106  
 
 107  
     public void setDefaultAffiliation(EntityAffiliation defaultAffiliation) {
 108  0
         this.defaultAffiliation = defaultAffiliation;
 109  0
     }
 110  
 
 111  
     /**
 112  
      * Gets this {@link KimEntityDefaultInfo}'s primary employment info.
 113  
      * @return the primary employment info for this {@link KimEntityDefaultInfo}, or null if none has been assigned.
 114  
      */
 115  
     public KimEntityEmploymentInformationInfo getPrimaryEmployment() {
 116  0
         return primaryEmployment;
 117  
     }
 118  
 
 119  
     public void setPrimaryEmployment(KimEntityEmploymentInformation primaryEmployment) {
 120  0
         if (primaryEmployment != null) {
 121  0
             if (primaryEmployment instanceof KimEntityEmploymentInformationInfo) {
 122  0
                 this.primaryEmployment = (KimEntityEmploymentInformationInfo) primaryEmployment;
 123  
             }
 124  
             else {
 125  0
                 this.primaryEmployment = new KimEntityEmploymentInformationInfo(primaryEmployment);
 126  
             }
 127  
         }
 128  0
     }
 129  
 
 130  
     public void setPrimaryEmployment(KimEntityEmploymentInformationInfo primaryEmployment) {
 131  0
         this.primaryEmployment = primaryEmployment;
 132  0
     }
 133  
 
 134  
     /**
 135  
      * Gets this {@link KimEntityDefaultInfo}'s List of {@link KimEntityExternalIdentifierInfo}S.
 136  
      * @return the List of {@link KimEntityExternalIdentifierInfo}S for this {@link KimEntityDefaultInfo}.
 137  
      * The returned List will never be null, an empty List will be assigned and returned if needed. 
 138  
      */
 139  
     public List<KimEntityExternalIdentifierInfo> getExternalIdentifiers() {
 140  
         // If our reference is null, assign and return an empty List
 141  0
         return (externalIdentifiers != null) ? 
 142  
                 externalIdentifiers : (externalIdentifiers = new ArrayList<KimEntityExternalIdentifierInfo>());
 143  
     }
 144  
 
 145  
     public void setExternalIdentifiers(
 146  
             List<KimEntityExternalIdentifierInfo> externalIdentifiers) {
 147  0
         this.externalIdentifiers = externalIdentifiers;
 148  0
     }
 149  
 
 150  
     /**
 151  
      * Gets this {@link KimEntityDefaultInfo}'s List of {@link Principal}s.
 152  
      * @return the List of {@link Principal}S for this {@link KimEntityDefaultInfo}.
 153  
      * The returned List will never be null, an empty List will be assigned and returned if needed. 
 154  
      */
 155  
     public List<Principal> getPrincipals() {
 156  
         // If our reference is null, assign and return an empty List
 157  0
         return (principals != null) ? principals : (principals = new ArrayList<Principal>());
 158  
     }
 159  
 
 160  
     public void setPrincipals(List<Principal> principals) {
 161  0
         this.principals = principals;
 162  0
     }
 163  
 
 164  
     /**
 165  
      * Gets this {@link KimEntityDefaultInfo}'s {@link KimEntityEntityTypeDefaultInfo} for the given type code.
 166  
      * @return the {@link KimEntityEntityTypeDefaultInfo} for the given type code for this {@link KimEntityDefaultInfo}, 
 167  
      * or null if none has been assigned.
 168  
      */
 169  
     public EntityTypeDataDefault getEntityType(String entityTypeCode) {
 170  0
         EntityTypeDataDefault result = null;
 171  0
         if (entityTypes == null) {
 172  0
             entityTypes = new ArrayList<EntityTypeDataDefault>();
 173  
         }
 174  0
         for (EntityTypeDataDefault entType : entityTypes) {
 175  0
             if (entType.getEntityTypeCode().equals(entityTypeCode)) {
 176  0
                 result = entType;
 177  
             }
 178  
         }
 179  0
         return result;
 180  
     }
 181  
 
 182  
     /**
 183  
      * Gets this {@link KimEntityDefaultInfo}'s privacy preferences.
 184  
      * @return the privacy preferences for this {@link KimEntityDefaultInfo}, or null if none has been assigned.
 185  
      */
 186  
     public EntityPrivacyPreferences getPrivacyPreferences() {
 187  0
         return privacyPreferences;
 188  
     }
 189  
 
 190  
     public void setPrivacyPreferences(EntityPrivacyPreferences privacyPreferences) {
 191  0
         this.privacyPreferences = privacyPreferences;
 192  0
     }
 193  
 
 194  
 }