Coverage Report - org.kuali.rice.kim.bo.entity.dto.KimEntityDefaultInfo
 
Classes in this File Line Coverage Branch Coverage Complexity
KimEntityDefaultInfo
0%
0/35
0%
0/14
1.368
 
 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.employment.EntityEmployment;
 20  
 import org.kuali.rice.kim.api.identity.external.EntityExternalIdentifier;
 21  
 import org.kuali.rice.kim.api.identity.name.EntityName;
 22  
 import org.kuali.rice.kim.api.identity.principal.Principal;
 23  
 import org.kuali.rice.kim.api.identity.privacy.EntityPrivacyPreferences;
 24  
 import org.kuali.rice.kim.api.identity.type.EntityTypeDataDefault;
 25  
 
 26  
 import java.util.ArrayList;
 27  
 import java.util.List;
 28  
 
 29  
 /**
 30  
  * default information for a KIM identity
 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 EntityName defaultName;
 40  
     protected List<Principal> principals;
 41  
     protected List<EntityTypeDataDefault> entityTypes;
 42  
     protected List<EntityAffiliation> affiliations;
 43  
     protected EntityAffiliation defaultAffiliation;
 44  
     protected EntityEmployment primaryEmployment;
 45  
     protected List<EntityExternalIdentifier> externalIdentifiers;
 46  
     protected EntityPrivacyPreferences privacyPreferences;
 47  
 
 48  
     /**
 49  
      * Gets this {@link KimEntityDefaultInfo}'s identity id.
 50  
      * @return the identity 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 EntityName getDefaultName() {
 65  0
         return defaultName;
 66  
     }
 67  
 
 68  
     public void setDefaultName(EntityName defaultName) {
 69  0
         this.defaultName = defaultName;
 70  0
     }
 71  
 
 72  
     /**
 73  
      * Gets this {@link KimEntityDefaultInfo}'s List of {@link KimEntityEntityTypeDefaultInfo}S.
 74  
      * @return the List of {@link KimEntityEntityTypeDefaultInfo}S for this {@link KimEntityDefaultInfo}.
 75  
      * The returned List will never be null, an empty List will be assigned and returned if needed. 
 76  
      */
 77  
     public List<EntityTypeDataDefault> getEntityTypes() {
 78  
         // If our reference is null, assign and return an empty List
 79  0
         return (entityTypes != null) ? entityTypes : (entityTypes = new ArrayList<EntityTypeDataDefault>());
 80  
     }
 81  
 
 82  
     public void setEntityTypes(List<EntityTypeDataDefault> entityTypes) {
 83  0
         this.entityTypes = entityTypes;
 84  0
     }
 85  
 
 86  
     /**
 87  
      * Gets this {@link KimEntityDefaultInfo}'s List of {@link EntityAffiliation}S.
 88  
      * @return the List of {@link EntityAffiliation}S for this {@link KimEntityDefaultInfo}.
 89  
      * The returned List will never be null, an empty List will be assigned and returned if needed. 
 90  
      */
 91  
     public List<EntityAffiliation> getAffiliations() {
 92  
         // If our reference is null, assign and return an empty List
 93  0
         return (affiliations != null) ? affiliations : (affiliations = new ArrayList<EntityAffiliation>());
 94  
     }
 95  
 
 96  
     public void setAffiliations(List<EntityAffiliation> affiliations) {
 97  0
         this.affiliations = affiliations;
 98  0
     }
 99  
 
 100  
     /**
 101  
      * Gets this {@link KimEntityDefaultInfo}'s affiliation info.
 102  
      * @return the affiliation info for this {@link KimEntityDefaultInfo}, or null if none has been assigned.
 103  
      */
 104  
     public EntityAffiliation getDefaultAffiliation() {
 105  0
         return defaultAffiliation;
 106  
     }
 107  
 
 108  
     public void setDefaultAffiliation(EntityAffiliation defaultAffiliation) {
 109  0
         this.defaultAffiliation = defaultAffiliation;
 110  0
     }
 111  
 
 112  
     /**
 113  
      * Gets this {@link KimEntityDefaultInfo}'s primary employment info.
 114  
      * @return the primary employment info for this {@link KimEntityDefaultInfo}, or null if none has been assigned.
 115  
      */
 116  
     public EntityEmployment getPrimaryEmployment() {
 117  0
         return primaryEmployment;
 118  
     }
 119  
 
 120  
     public void setPrimaryEmployment(EntityEmployment primaryEmployment) {
 121  0
         this.primaryEmployment = primaryEmployment;
 122  0
     }
 123  
 
 124  
     /**
 125  
      * Gets this {@link KimEntityDefaultInfo}'s List of {@link org.kuali.rice.kim.api.identity.external.EntityExternalIdentifier}S.
 126  
      * @return the List of {@link org.kuali.rice.kim.api.identity.external.EntityExternalIdentifier}S for this {@link KimEntityDefaultInfo}.
 127  
      * The returned List will never be null, an empty List will be assigned and returned if needed. 
 128  
      */
 129  
     public List<EntityExternalIdentifier> getExternalIdentifiers() {
 130  
         // If our reference is null, assign and return an empty List
 131  0
         return (externalIdentifiers != null) ? 
 132  
                 externalIdentifiers : (externalIdentifiers = new ArrayList<EntityExternalIdentifier>());
 133  
     }
 134  
 
 135  
     public void setExternalIdentifiers(
 136  
             List<EntityExternalIdentifier> externalIdentifiers) {
 137  0
         this.externalIdentifiers = externalIdentifiers;
 138  0
     }
 139  
 
 140  
     /**
 141  
      * Gets this {@link KimEntityDefaultInfo}'s List of {@link Principal}s.
 142  
      * @return the List of {@link Principal}S for this {@link KimEntityDefaultInfo}.
 143  
      * The returned List will never be null, an empty List will be assigned and returned if needed. 
 144  
      */
 145  
     public List<Principal> getPrincipals() {
 146  
         // If our reference is null, assign and return an empty List
 147  0
         return (principals != null) ? principals : (principals = new ArrayList<Principal>());
 148  
     }
 149  
 
 150  
     public void setPrincipals(List<Principal> principals) {
 151  0
         this.principals = principals;
 152  0
     }
 153  
 
 154  
     /**
 155  
      * Gets this {@link KimEntityDefaultInfo}'s {@link KimEntityEntityTypeDefaultInfo} for the given type code.
 156  
      * @return the {@link KimEntityEntityTypeDefaultInfo} for the given type code for this {@link KimEntityDefaultInfo}, 
 157  
      * or null if none has been assigned.
 158  
      */
 159  
     public EntityTypeDataDefault getEntityType(String entityTypeCode) {
 160  0
         EntityTypeDataDefault result = null;
 161  0
         if (entityTypes == null) {
 162  0
             entityTypes = new ArrayList<EntityTypeDataDefault>();
 163  
         }
 164  0
         for (EntityTypeDataDefault entType : entityTypes) {
 165  0
             if (entType.getEntityTypeCode().equals(entityTypeCode)) {
 166  0
                 result = entType;
 167  
             }
 168  
         }
 169  0
         return result;
 170  
     }
 171  
 
 172  
     /**
 173  
      * Gets this {@link KimEntityDefaultInfo}'s privacy preferences.
 174  
      * @return the privacy preferences for this {@link KimEntityDefaultInfo}, or null if none has been assigned.
 175  
      */
 176  
     public EntityPrivacyPreferences getPrivacyPreferences() {
 177  0
         return privacyPreferences;
 178  
     }
 179  
 
 180  
     public void setPrivacyPreferences(EntityPrivacyPreferences privacyPreferences) {
 181  0
         this.privacyPreferences = privacyPreferences;
 182  0
     }
 183  
 
 184  
 }