Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
NamespaceEbo |
|
| 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 | package org.kuali.rice.core.framework.namespace | |
18 | ||
19 | import org.kuali.rice.core.api.namespace.Namespace | |
20 | import org.kuali.rice.core.api.namespace.NamespaceContract | |
21 | import org.kuali.rice.krad.bo.ExternalizableBusinessObject | |
22 | ||
23 | import org.kuali.rice.krad.bo.MutableInactivatable | |
24 | ||
25 | //@ToString | |
26 | class NamespaceEbo implements NamespaceContract, MutableInactivatable, ExternalizableBusinessObject { | |
27 | ||
28 | private static final long serialVersionUID = 1L; | |
29 | ||
30 | def String applicationId | |
31 | def String code | |
32 | def String name | |
33 | def boolean active | |
34 | def Long versionNumber | |
35 | def String objectId | |
36 | ||
37 | /** | |
38 | * Converts a mutable bo to its immutable counterpart | |
39 | * @param bo the mutable business object | |
40 | * @return the immutable object | |
41 | */ | |
42 | static Namespace to(NamespaceEbo bo) { | |
43 | 0 | if (bo == null) { |
44 | 0 | return null |
45 | } | |
46 | ||
47 | 0 | return Namespace.Builder.create(bo).build(); |
48 | } | |
49 | ||
50 | /** | |
51 | * Converts a immutable object to its mutable counterpart | |
52 | * @param im immutable object | |
53 | * @return the mutable bo | |
54 | */ | |
55 | static NamespaceEbo from(Namespace im) { | |
56 | 0 | if (im == null) { |
57 | 0 | return null |
58 | } | |
59 | ||
60 | 0 | NamespaceEbo bo = new NamespaceEbo() |
61 | 0 | bo.applicationId = im.applicationId |
62 | 0 | bo.active = im.active |
63 | 0 | bo.code = im.code |
64 | 0 | bo.name = im.name |
65 | 0 | bo.versionNumber = im.versionNumber |
66 | 0 | bo.objectId = im.objectId |
67 | ||
68 | 0 | return bo |
69 | } | |
70 | ||
71 | void refresh() { } | |
72 | } |