Coverage Report - org.kuali.rice.kim.bo.entity.dto.KimEntityDefaultInfo
 
Classes in this File Line Coverage Branch Coverage Complexity
KimEntityDefaultInfo
0%
0/49
0%
0/24
1.545
 
 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 java.util.ArrayList;
 19  
 import java.util.List;
 20  
 
 21  
 import org.kuali.rice.kim.api.entity.principal.Principal;
 22  
 import org.kuali.rice.kim.api.entity.privacy.EntityPrivacyPreferences;
 23  
 import org.kuali.rice.kim.api.entity.privacy.EntityPrivacyPreferencesContract;
 24  
 import org.kuali.rice.kim.bo.entity.KimEntityAffiliation;
 25  
 import org.kuali.rice.kim.bo.entity.KimEntityEmploymentInformation;
 26  
 import org.kuali.rice.kim.bo.entity.KimEntityName;
 27  
 import org.kuali.rice.kim.api.entity.type.EntityTypeDataDefault;
 28  
 
 29  
 /**
 30  
  * default information for a KIM entity
 31  
  * 
 32  
  * @author Kuali Rice Team (rice.collab@kuali.org)
 33  
  * 
 34  
  */
 35  0
 public class KimEntityDefaultInfo extends KimInactivatableInfo {
 36  
 
 37  
     private static final long serialVersionUID = 7930630152792502380L;
 38  
     protected String entityId;
 39  
     protected KimEntityNameInfo defaultName;
 40  
     protected List<Principal> principals;
 41  
     protected List<EntityTypeDataDefault> entityTypes;
 42  
     protected List<KimEntityAffiliationInfo> affiliations;
 43  
     protected KimEntityAffiliationInfo defaultAffiliation;
 44  
     protected KimEntityEmploymentInformationInfo primaryEmployment;
 45  
     protected List<KimEntityExternalIdentifierInfo> externalIdentifiers;
 46  
     protected EntityPrivacyPreferences privacyPreferences;
 47  
 
 48  
     /**
 49  
      * Gets this {@link KimEntityDefaultInfo}'s entity id.
 50  
      * @return the entity id for this {@link KimEntityDefaultInfo}, or null if none has been assigned.
 51  
      */
 52  
     public String getEntityId() {
 53  0
         return this.entityId;
 54  
     }
 55  
 
 56  
     public void setEntityId(String entityId) {
 57  0
         this.entityId = entityId;
 58  0
     }
 59  
 
 60  
     /**
 61  
      * Gets this {@link KimEntityDefaultInfo}'s default name.
 62  
      * @return the default name for this {@link KimEntityDefaultInfo}, or null if none has been assigned.
 63  
      */
 64  
     public KimEntityNameInfo getDefaultName() {
 65  0
         return defaultName;
 66  
     }
 67  
 
 68  
     public void setDefaultName(KimEntityName defaultName) {
 69  0
         if (defaultName instanceof KimEntityNameInfo) {
 70  0
             this.defaultName = (KimEntityNameInfo) defaultName;
 71  
         }
 72  
         else {
 73  0
             this.defaultName = new KimEntityNameInfo(defaultName);
 74  
         }
 75  0
     }
 76  
 
 77  
     public void setDefaultName(KimEntityNameInfo defaultName) {
 78  0
         this.defaultName = defaultName;
 79  0
     }
 80  
 
 81  
     /**
 82  
      * Gets this {@link KimEntityDefaultInfo}'s List of {@link KimEntityEntityTypeDefaultInfo}S.
 83  
      * @return the List of {@link KimEntityEntityTypeDefaultInfo}S for this {@link KimEntityDefaultInfo}.
 84  
      * The returned List will never be null, an empty List will be assigned and returned if needed. 
 85  
      */
 86  
     public List<EntityTypeDataDefault> getEntityTypes() {
 87  
         // If our reference is null, assign and return an empty List
 88  0
         return (entityTypes != null) ? entityTypes : (entityTypes = new ArrayList<EntityTypeDataDefault>());
 89  
     }
 90  
 
 91  
     public void setEntityTypes(List<EntityTypeDataDefault> entityTypes) {
 92  0
         this.entityTypes = entityTypes;
 93  0
     }
 94  
 
 95  
     /**
 96  
      * Gets this {@link KimEntityDefaultInfo}'s List of {@link KimEntityAffiliationInfo}S.
 97  
      * @return the List of {@link KimEntityAffiliationInfo}S for this {@link KimEntityDefaultInfo}.
 98  
      * The returned List will never be null, an empty List will be assigned and returned if needed. 
 99  
      */
 100  
     public List<KimEntityAffiliationInfo> getAffiliations() {
 101  
         // If our reference is null, assign and return an empty List
 102  0
         return (affiliations != null) ? affiliations : (affiliations = new ArrayList<KimEntityAffiliationInfo>());
 103  
     }
 104  
 
 105  
     public void setAffiliations(List<KimEntityAffiliationInfo> affiliations) {
 106  0
         this.affiliations = affiliations;
 107  0
     }
 108  
 
 109  
     /**
 110  
      * Gets this {@link KimEntityDefaultInfo}'s affiliation info.
 111  
      * @return the affiliation info for this {@link KimEntityDefaultInfo}, or null if none has been assigned.
 112  
      */
 113  
     public KimEntityAffiliationInfo getDefaultAffiliation() {
 114  0
         return defaultAffiliation;
 115  
     }
 116  
 
 117  
     public void setDefaultAffiliation(KimEntityAffiliation defaultAffiliation) {
 118  0
         if (defaultAffiliation != null) {
 119  0
             if (defaultAffiliation instanceof KimEntityAffiliationInfo) {
 120  0
                 this.defaultAffiliation = (KimEntityAffiliationInfo) defaultAffiliation;
 121  
             }
 122  
             else {
 123  0
                 this.defaultAffiliation = new KimEntityAffiliationInfo(defaultAffiliation);
 124  
             }
 125  
         }
 126  0
     }
 127  
 
 128  
     public void setDefaultAffiliation(KimEntityAffiliationInfo defaultAffiliation) {
 129  0
         this.defaultAffiliation = defaultAffiliation;
 130  0
     }
 131  
 
 132  
     /**
 133  
      * Gets this {@link KimEntityDefaultInfo}'s primary employment info.
 134  
      * @return the primary employment info for this {@link KimEntityDefaultInfo}, or null if none has been assigned.
 135  
      */
 136  
     public KimEntityEmploymentInformationInfo getPrimaryEmployment() {
 137  0
         return primaryEmployment;
 138  
     }
 139  
 
 140  
     public void setPrimaryEmployment(KimEntityEmploymentInformation primaryEmployment) {
 141  0
         if (primaryEmployment != null) {
 142  0
             if (primaryEmployment instanceof KimEntityEmploymentInformationInfo) {
 143  0
                 this.primaryEmployment = (KimEntityEmploymentInformationInfo) primaryEmployment;
 144  
             }
 145  
             else {
 146  0
                 this.primaryEmployment = new KimEntityEmploymentInformationInfo(primaryEmployment);
 147  
             }
 148  
         }
 149  0
     }
 150  
 
 151  
     public void setPrimaryEmployment(KimEntityEmploymentInformationInfo primaryEmployment) {
 152  0
         this.primaryEmployment = primaryEmployment;
 153  0
     }
 154  
 
 155  
     /**
 156  
      * Gets this {@link KimEntityDefaultInfo}'s List of {@link KimEntityExternalIdentifierInfo}S.
 157  
      * @return the List of {@link KimEntityExternalIdentifierInfo}S for this {@link KimEntityDefaultInfo}.
 158  
      * The returned List will never be null, an empty List will be assigned and returned if needed. 
 159  
      */
 160  
     public List<KimEntityExternalIdentifierInfo> getExternalIdentifiers() {
 161  
         // If our reference is null, assign and return an empty List
 162  0
         return (externalIdentifiers != null) ? 
 163  
                 externalIdentifiers : (externalIdentifiers = new ArrayList<KimEntityExternalIdentifierInfo>());
 164  
     }
 165  
 
 166  
     public void setExternalIdentifiers(
 167  
             List<KimEntityExternalIdentifierInfo> externalIdentifiers) {
 168  0
         this.externalIdentifiers = externalIdentifiers;
 169  0
     }
 170  
 
 171  
     /**
 172  
      * Gets this {@link KimEntityDefaultInfo}'s List of {@link Principal}s.
 173  
      * @return the List of {@link Principal}S for this {@link KimEntityDefaultInfo}.
 174  
      * The returned List will never be null, an empty List will be assigned and returned if needed. 
 175  
      */
 176  
     public List<Principal> getPrincipals() {
 177  
         // If our reference is null, assign and return an empty List
 178  0
         return (principals != null) ? principals : (principals = new ArrayList<Principal>());
 179  
     }
 180  
 
 181  
     public void setPrincipals(List<Principal> principals) {
 182  0
         this.principals = principals;
 183  0
     }
 184  
 
 185  
     /**
 186  
      * Gets this {@link KimEntityDefaultInfo}'s {@link KimEntityEntityTypeDefaultInfo} for the given type code.
 187  
      * @return the {@link KimEntityEntityTypeDefaultInfo} for the given type code for this {@link KimEntityDefaultInfo}, 
 188  
      * or null if none has been assigned.
 189  
      */
 190  
     public EntityTypeDataDefault getEntityType(String entityTypeCode) {
 191  0
         EntityTypeDataDefault result = null;
 192  0
         if (entityTypes == null) {
 193  0
             entityTypes = new ArrayList<EntityTypeDataDefault>();
 194  
         }
 195  0
         for (EntityTypeDataDefault entType : entityTypes) {
 196  0
             if (entType.getEntityTypeCode().equals(entityTypeCode)) {
 197  0
                 result = entType;
 198  
             }
 199  
         }
 200  0
         return result;
 201  
     }
 202  
 
 203  
     /**
 204  
      * Gets this {@link KimEntityDefaultInfo}'s privacy preferences.
 205  
      * @return the privacy preferences for this {@link KimEntityDefaultInfo}, or null if none has been assigned.
 206  
      */
 207  
     public EntityPrivacyPreferences getPrivacyPreferences() {
 208  0
         return privacyPreferences;
 209  
     }
 210  
 
 211  
     public void setPrivacyPreferences(EntityPrivacyPreferences privacyPreferences) {
 212  0
         this.privacyPreferences = privacyPreferences;
 213  0
     }
 214  
 
 215  
 }