1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
package org.kuali.rice.krms.impl.repository |
17 | |
|
18 | |
import org.kuali.rice.core.api.mo.common.active.MutableInactivatable |
19 | |
import org.kuali.rice.krad.bo.PersistableBusinessObjectBase |
20 | |
import org.kuali.rice.krms.api.repository.type.KrmsTypeDefinitionContract |
21 | |
|
22 | |
public class KrmsTypeBo extends PersistableBusinessObjectBase implements MutableInactivatable, KrmsTypeDefinitionContract { |
23 | |
|
24 | |
def String id |
25 | |
def String name |
26 | |
def String namespace |
27 | |
def String serviceName |
28 | |
def boolean active |
29 | |
def List<KrmsTypeAttributeBo> attributes |
30 | |
|
31 | |
|
32 | |
|
33 | |
|
34 | |
|
35 | |
static org.kuali.rice.krms.api.repository.type.KrmsTypeDefinition to(KrmsTypeBo bo) { |
36 | 0 | if (bo == null) { return null } |
37 | 12 | return org.kuali.rice.krms.api.repository.type.KrmsTypeDefinition.Builder.create(bo).build(); |
38 | |
} |
39 | |
|
40 | |
|
41 | |
|
42 | |
|
43 | |
|
44 | |
|
45 | |
static KrmsTypeBo from(org.kuali.rice.krms.api.repository.type.KrmsTypeDefinition im) { |
46 | 0 | if (im == null) { return null } |
47 | |
|
48 | 3 | KrmsTypeBo bo = new KrmsTypeBo() |
49 | 3 | bo.id = im.id |
50 | 3 | bo.name = im.name |
51 | 3 | bo.namespace = im.namespace |
52 | 3 | bo.serviceName = im.serviceName |
53 | 0 | bo.active = (im.active == null) ? true : im.active; |
54 | 3 | bo.attributes = new ArrayList<KrmsTypeAttributeBo>() |
55 | 3 | for( attr in im.attributes ){ |
56 | 6 | bo.attributes.add(KrmsTypeAttributeBo.from(attr)) |
57 | |
} |
58 | 3 | bo.versionNumber = im.versionNumber |
59 | 3 | return bo |
60 | |
} |
61 | |
|
62 | |
} |