Coverage Report - org.kuali.rice.kim.impl.identity.privacy.EntityPrivacyPreferencesBo
 
Classes in this File Line Coverage Branch Coverage Complexity
EntityPrivacyPreferencesBo
0%
0/13
0%
0/8
0
 
 1  
 /**
 2  
  * Copyright 2005-2011 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.impl.identity.privacy
 17  
 
 18  
 import javax.persistence.Entity
 19  
 import javax.persistence.Table
 20  
 import org.kuali.rice.kim.api.identity.privacy.EntityPrivacyPreferencesContract
 21  
 import org.kuali.rice.krad.bo.PersistableBusinessObjectBase
 22  
 import javax.persistence.Column
 23  
 import javax.persistence.Id
 24  
 import org.hibernate.annotations.Type
 25  
 
 26  
 import org.kuali.rice.kim.api.identity.privacy.EntityPrivacyPreferences
 27  
 
 28  
 @Entity
 29  
 @Table(name = "KRIM_ENTITY_PRIV_PREF_T")
 30  
 class EntityPrivacyPreferencesBo extends PersistableBusinessObjectBase implements EntityPrivacyPreferencesContract {
 31  
             private static final long serialVersionUID = 1L;
 32  
 
 33  
         @Id
 34  
         @Column(name = "ENTITY_ID")
 35  
         String entityId;
 36  
 
 37  
         @Type(type="yes_no")
 38  
         @Column(name="SUPPRESS_NM_IND")
 39  
         boolean suppressName;
 40  
 
 41  
         @Type(type="yes_no")
 42  
         @Column(name="SUPPRESS_EMAIL_IND")
 43  
         boolean suppressEmail;
 44  
 
 45  
         @Type(type="yes_no")
 46  
         @Column(name="SUPPRESS_ADDR_IND")
 47  
         boolean suppressAddress;
 48  
 
 49  
         @Type(type="yes_no")
 50  
         @Column(name="SUPPRESS_PHONE_IND")
 51  
         boolean suppressPhone;
 52  
 
 53  
         @Type(type="yes_no")
 54  
         @Column(name="SUPPRESS_PRSNL_IND")
 55  
         boolean suppressPersonal;
 56  
 
 57  
  /*
 58  
    * Converts a mutable EntityPhoneBo to an immutable EntityPhone representation.
 59  
    * @param bo
 60  
    * @return an immutable Country
 61  
    */
 62  
   static EntityPrivacyPreferences to(EntityPrivacyPreferencesBo bo) {
 63  0
     if (bo == null) { return null }
 64  0
     return EntityPrivacyPreferences.Builder.create(bo).build()
 65  
   }
 66  
 
 67  
   /**
 68  
    * Creates a CountryBo business object from an immutable representation of a Country.
 69  
    * @param an immutable Country
 70  
    * @return a CountryBo
 71  
    */
 72  
   static EntityPrivacyPreferencesBo from(EntityPrivacyPreferences immutable) {
 73  0
     if (immutable == null) {return null}
 74  
 
 75  0
     EntityPrivacyPreferencesBo bo = new EntityPrivacyPreferencesBo()
 76  
 
 77  0
     bo.entityId = immutable.entityId
 78  0
     bo.suppressAddress = immutable.suppressAddress
 79  0
     bo.suppressEmail = immutable.suppressEmail
 80  0
     bo.suppressName = immutable.suppressName
 81  0
     bo.suppressPersonal = immutable.suppressPersonal
 82  0
     bo.suppressPhone = immutable.suppressPhone
 83  0
     bo.versionNumber = immutable.versionNumber
 84  0
     bo.objectId = immutable.objectId
 85  
 
 86  0
     return bo;
 87  
   }
 88  
 
 89  
 }