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