Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
KrmsTypeAttributeBo |
|
| 0.0;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.krms.impl.repository | |
17 | ||
18 | import org.kuali.rice.krad.bo.PersistableBusinessObjectBase | |
19 | import org.kuali.rice.krms.api.repository.type.KrmsTypeAttribute | |
20 | import org.kuali.rice.krms.api.repository.type.KrmsTypeAttributeContract | |
21 | import org.kuali.rice.core.api.mo.common.active.MutableInactivatable | |
22 | ||
23 | public class KrmsTypeAttributeBo extends PersistableBusinessObjectBase implements MutableInactivatable, KrmsTypeAttributeContract { | |
24 | ||
25 | def String id | |
26 | def String typeId | |
27 | def String attributeDefinitionId | |
28 | def Integer sequenceNumber | |
29 | def boolean active | |
30 | ||
31 | /** | |
32 | * Converts a mutable bo to it's immutable counterpart | |
33 | * @param bo the mutable business object | |
34 | * @return the immutable object | |
35 | */ | |
36 | static KrmsTypeAttribute to(KrmsTypeAttributeBo bo) { | |
37 | 0 | if (bo == null) { return null } |
38 | 0 | return org.kuali.rice.krms.api.repository.type.KrmsTypeAttribute.Builder |
39 | .create(bo).build() | |
40 | } | |
41 | ||
42 | /** | |
43 | * Converts a immutable object to it's mutable bo counterpart | |
44 | * @param im immutable object | |
45 | * @return the mutable bo | |
46 | */ | |
47 | static KrmsTypeAttributeBo from(KrmsTypeAttribute im) { | |
48 | 0 | if (im == null) { |
49 | 0 | return null |
50 | } | |
51 | 0 | KrmsTypeAttributeBo bo = new KrmsTypeAttributeBo() |
52 | 0 | bo.id = im.id |
53 | 0 | bo.typeId = im.typeId |
54 | 0 | bo.attributeDefinitionId = im.attributeDefinitionId |
55 | 0 | bo.sequenceNumber = im.sequenceNumber |
56 | 0 | bo.active = im.active |
57 | 0 | return bo |
58 | } | |
59 | ||
60 | } |