Coverage Report - org.kuali.rice.kim.ldap.EntityTypeContactInfoDefaultMapper
 
Classes in this File Line Coverage Branch Coverage Complexity
EntityTypeContactInfoDefaultMapper
0%
0/20
N/A
1
 
 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.ldap;
 17  
 
 18  
 import org.springframework.ldap.core.ContextMapper;
 19  
 import org.springframework.ldap.core.DirContextOperations;
 20  
 import org.springframework.ldap.core.support.AbstractContextMapper;
 21  
 
 22  
 import org.kuali.rice.kim.api.identity.address.EntityAddress;
 23  
 import org.kuali.rice.kim.api.identity.email.EntityEmail;
 24  
 import org.kuali.rice.kim.api.identity.type.EntityTypeContactInfo;
 25  
 import org.kuali.rice.kim.api.identity.type.EntityTypeContactInfoDefault;
 26  
 import org.kuali.rice.kim.util.Constants;
 27  
 
 28  
 /**
 29  
  * 
 30  
  * @author Kuali Rice Team (rice.collab@kuali.org)
 31  
  */
 32  0
 public class EntityTypeContactInfoDefaultMapper extends AbstractContextMapper {
 33  
     private Constants constants;
 34  
     
 35  
     private EntityAddressMapper addressMapper;
 36  
     private EntityPhoneMapper phoneMapper;
 37  
     private EntityEmailMapper emailMapper;
 38  
 
 39  
     public EntityTypeContactInfoDefault.Builder mapFromContext(DirContextOperations context) {
 40  0
         return (EntityTypeContactInfoDefault.Builder) doMapFromContext(context);
 41  
     }
 42  
 
 43  
     public Object doMapFromContext(DirContextOperations context) {
 44  0
         final EntityTypeContactInfoDefault.Builder retval = EntityTypeContactInfoDefault.Builder.create(); 
 45  
         
 46  0
         retval.setDefaultAddress(getAddressMapper().mapFromContext(context));
 47  0
         retval.setDefaultPhoneNumber(getPhoneMapper().mapFromContext(context));
 48  0
         retval.setDefaultEmailAddress(getEmailMapper().mapFromContext(context));
 49  0
         retval.setEntityTypeCode(getConstants().getPersonEntityTypeCode());
 50  
         // debug("Created Entity Type with code ", retval.getEntityTypeCode());
 51  
         
 52  0
         return retval;
 53  
     }
 54  
     
 55  
     /**
 56  
      * Gets the value of constants
 57  
      *
 58  
      * @return the value of constants
 59  
      */
 60  
     public final Constants getConstants() {
 61  0
         return this.constants;
 62  
     }
 63  
 
 64  
     /**
 65  
      * Sets the value of constants
 66  
      *
 67  
      * @param argConstants Value to assign to this.constants
 68  
      */
 69  
     public final void setConstants(final Constants argConstants) {
 70  0
         this.constants = argConstants;
 71  0
     }
 72  
     /**
 73  
      * Gets the value of addressMapper
 74  
      *
 75  
      * @return the value of addressMapper
 76  
      */
 77  
     public final EntityAddressMapper getAddressMapper() {
 78  0
         return this.addressMapper;
 79  
     }
 80  
 
 81  
     /**
 82  
      * Sets the value of addressMapper
 83  
      *
 84  
      * @param argAddressMapper Value to assign to this.addressMapper
 85  
      */
 86  
     public final void setAddressMapper(final EntityAddressMapper argAddressMapper) {
 87  0
         this.addressMapper = argAddressMapper;
 88  0
     }
 89  
 
 90  
     /**
 91  
      * Gets the value of phoneMapper
 92  
      *
 93  
      * @return the value of phoneMapper
 94  
      */
 95  
     public final EntityPhoneMapper getPhoneMapper() {
 96  0
         return this.phoneMapper;
 97  
     }
 98  
 
 99  
     /**
 100  
      * Sets the value of phoneMapper
 101  
      *
 102  
      * @param argPhoneMapper Value to assign to this.phoneMapper
 103  
      */
 104  
     public final void setPhoneMapper(final EntityPhoneMapper argPhoneMapper) {
 105  0
         this.phoneMapper = argPhoneMapper;
 106  0
     }
 107  
 
 108  
     /**
 109  
      * Gets the value of emailMapper
 110  
      *
 111  
      * @return the value of emailMapper
 112  
      */
 113  
     public final EntityEmailMapper getEmailMapper() {
 114  0
         return this.emailMapper;
 115  
     }
 116  
 
 117  
     /**
 118  
      * Sets the value of emailMapper
 119  
      *
 120  
      * @param argEmailMapper Value to assign to this.emailMapper
 121  
      */
 122  
     public final void setEmailMapper(final EntityEmailMapper argEmailMapper) {
 123  0
         this.emailMapper = argEmailMapper;
 124  0
     }
 125  
 }