Coverage Report - org.kuali.rice.location.framework.postalcode.PostalCodeEbo
 
Classes in this File Line Coverage Branch Coverage Complexity
PostalCodeEbo
0%
0/14
0%
0/4
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.location.framework.postalcode
 17  
 
 18  
 import org.kuali.rice.krad.bo.ExternalizableBusinessObject
 19  
 
 20  
 import org.kuali.rice.location.api.postalcode.PostalCode
 21  
 import org.kuali.rice.location.api.postalcode.PostalCodeContract
 22  
 import org.kuali.rice.location.framework.country.CountryEbo
 23  
 import org.kuali.rice.location.framework.county.CountyEbo
 24  
 import org.kuali.rice.location.framework.state.StateEbo
 25  
 import org.kuali.rice.core.api.mo.common.active.MutableInactivatable
 26  
 
 27  
 //@ToString
 28  
 class PostalCodeEbo implements MutableInactivatable, PostalCodeContract, ExternalizableBusinessObject {
 29  
     def String code;
 30  
     def String countryCode;
 31  
     def String cityName;
 32  
     def String stateCode;
 33  
     def String countyCode;
 34  
     def boolean active;
 35  
     def CountryEbo country;
 36  
     def StateEbo state;
 37  
     def CountyEbo county;
 38  
     def Long versionNumber;
 39  
 
 40  
     /**
 41  
      * Converts a mutable bo to its immutable counterpart
 42  
      * @param bo the mutable business object
 43  
      * @return the immutable object
 44  
      */
 45  
     static PostalCode to(PostalCodeEbo bo) {
 46  0
         if (bo == null) {
 47  0
             return null
 48  
         }
 49  
 
 50  0
         return PostalCode.Builder.create(bo).build();
 51  
     }
 52  
 
 53  
     /**
 54  
      * Converts a immutable object to its mutable counterpart
 55  
      * @param im immutable object
 56  
      * @return the mutable bo
 57  
      */
 58  
     static PostalCodeEbo from(PostalCode im) {
 59  0
         if (im == null) {
 60  0
             return null
 61  
         }
 62  
 
 63  0
         PostalCodeEbo bo = new PostalCodeEbo()
 64  0
         bo.code = im.code
 65  0
         bo.countryCode = im.countryCode
 66  0
         bo.cityName = im.cityName
 67  0
         bo.active = im.active
 68  0
         bo.stateCode = im.stateCode
 69  0
         bo.cityName = im.cityName
 70  0
         bo.versionNumber = im.versionNumber
 71  
 
 72  0
         return bo
 73  
     }
 74  
 
 75  
     void refresh() { }
 76  
 }