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.krad.bo.PersistableBusinessObjectBase |
19 | |
import org.kuali.rice.krms.api.repository.category.CategoryDefinitionContract |
20 | |
import org.kuali.rice.krms.api.repository.category.CategoryDefinition |
21 | |
|
22 | |
class CategoryBo extends PersistableBusinessObjectBase implements CategoryDefinitionContract { |
23 | |
|
24 | |
def String id |
25 | |
def String name |
26 | |
def String namespace |
27 | |
|
28 | |
|
29 | |
|
30 | |
|
31 | |
|
32 | |
|
33 | |
static CategoryDefinition to(CategoryBo bo) { |
34 | 0 | if (bo == null) { return null } |
35 | |
|
36 | 0 | return org.kuali.rice.krms.api.repository.category.CategoryDefinition.Builder.create(bo).build() |
37 | |
} |
38 | |
|
39 | |
|
40 | |
|
41 | |
|
42 | |
|
43 | |
|
44 | |
static List<CategoryDefinition> to(List<CategoryBo> bos) { |
45 | 0 | if (bos == null) { return null } |
46 | |
|
47 | 0 | List<CategoryDefinition> categories = new ArrayList<CategoryDefinition>(); |
48 | 0 | for (CategoryBo p : bos){ |
49 | 0 | categories.add(CategoryDefinition.Builder.create(p).build()) |
50 | |
} |
51 | 0 | return Collections.unmodifiableList(categories) |
52 | |
} |
53 | |
|
54 | |
|
55 | |
|
56 | |
|
57 | |
|
58 | |
|
59 | |
static CategoryBo from(CategoryDefinition im) { |
60 | 0 | if (im == null) { return null } |
61 | |
|
62 | 15 | CategoryBo bo = new CategoryBo() |
63 | 15 | bo.id = im.id |
64 | 15 | bo.name = im.name |
65 | 15 | bo.namespace = im.namespace |
66 | 15 | bo.versionNumber = im.versionNumber |
67 | 15 | return bo |
68 | |
} |
69 | |
|
70 | |
static List<CategoryBo> from(List<CategoryDefinition> ims){ |
71 | 0 | if (ims == null) {return null } |
72 | |
|
73 | 0 | List<CategoryBo> bos = new ArrayList<CategoryBo>(); |
74 | 0 | for (CategoryBo im : ims){ |
75 | 0 | CategoryBo bo = from(im) |
76 | 0 | bos.add(bo); |
77 | |
} |
78 | 0 | return Collections.unmodifiableList(bos) |
79 | |
} |
80 | |
} |