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