Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
CountryEbo |
|
| 0.0;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 | ||
18 | ||
19 | ||
20 | ||
21 | ||
22 | ||
23 | package org.kuali.rice.shareddata.framework.country | |
24 | ||
25 | import org.kuali.rice.krad.bo.ExternalizableBusinessObject | |
26 | ||
27 | import org.kuali.rice.shareddata.api.country.Country | |
28 | import org.kuali.rice.shareddata.api.country.CountryContract | |
29 | import org.kuali.rice.krad.bo.MutableInactivatable | |
30 | ||
31 | //@ToString | |
32 | class CountryEbo implements MutableInactivatable, CountryContract, ExternalizableBusinessObject { | |
33 | def String code; | |
34 | def String alternateCode; | |
35 | def String name; | |
36 | def boolean restricted; | |
37 | def boolean active; | |
38 | def Long versionNumber | |
39 | ||
40 | /** | |
41 | * Converts a mutable CountryEbo to an immutable Country representation. | |
42 | * @param bo | |
43 | * @return an immutable Country | |
44 | */ | |
45 | static Country to(CountryEbo bo) { | |
46 | 0 | if (bo == null) { return null } |
47 | 0 | return Country.Builder.create(bo).build() |
48 | } | |
49 | ||
50 | /** | |
51 | * Creates a CountryEbo business object from an immutable representation of a Country. | |
52 | * @param an immutable Country | |
53 | * @return a CountryEbo | |
54 | */ | |
55 | static CountryEbo from(Country immutable) { | |
56 | 0 | if (immutable == null) {return null} |
57 | ||
58 | 0 | CountryEbo bo = new CountryEbo() |
59 | 0 | bo.code = immutable.code |
60 | 0 | bo.alternateCode = immutable.alternateCode |
61 | 0 | bo.name = immutable.name |
62 | 0 | bo.restricted = immutable.restricted |
63 | 0 | bo.active = immutable.active |
64 | 0 | bo.versionNumber = immutable.versionNumber |
65 | ||
66 | 0 | return bo; |
67 | } | |
68 | ||
69 | void refresh() { } | |
70 | } |