1 | |
package org.kuali.rice.krms.impl.repository |
2 | |
|
3 | |
import org.kuali.rice.krad.bo.PersistableBusinessObjectBase |
4 | |
import org.kuali.rice.krms.api.repository.category.CategoryDefinitionContract |
5 | |
import org.kuali.rice.krms.api.repository.category.CategoryDefinition |
6 | |
|
7 | |
class CategoryBo extends PersistableBusinessObjectBase implements CategoryDefinitionContract { |
8 | |
|
9 | |
def String id |
10 | |
def String name |
11 | |
def String namespace |
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
|
17 | |
|
18 | |
static CategoryDefinition to(CategoryBo bo) { |
19 | 0 | if (bo == null) { return null } |
20 | |
|
21 | 0 | return org.kuali.rice.krms.api.repository.category.CategoryDefinition.Builder.create(bo).build() |
22 | |
} |
23 | |
|
24 | |
|
25 | |
|
26 | |
|
27 | |
|
28 | |
|
29 | |
static List<CategoryDefinition> to(List<CategoryBo> bos) { |
30 | 0 | if (bos == null) { return null } |
31 | |
|
32 | 0 | List<CategoryDefinition> categories = new ArrayList<CategoryDefinition>(); |
33 | 0 | for (CategoryBo p : bos){ |
34 | 0 | categories.add(CategoryDefinition.Builder.create(p).build()) |
35 | |
} |
36 | 0 | return Collections.unmodifiableList(categories) |
37 | |
} |
38 | |
|
39 | |
|
40 | |
|
41 | |
|
42 | |
|
43 | |
|
44 | |
static CategoryBo from(CategoryDefinition im) { |
45 | 15 | if (im == null) { return null } |
46 | |
|
47 | 15 | CategoryBo bo = new CategoryBo() |
48 | 15 | bo.id = im.id |
49 | 15 | bo.name = im.name |
50 | 15 | bo.namespace = im.namespace |
51 | 15 | bo.versionNumber = im.versionNumber |
52 | 15 | return bo |
53 | |
} |
54 | |
|
55 | |
static List<CategoryBo> from(List<CategoryDefinition> ims){ |
56 | 0 | if (ims == null) {return null } |
57 | |
|
58 | 0 | List<CategoryBo> bos = new ArrayList<CategoryBo>(); |
59 | 0 | for (CategoryBo im : ims){ |
60 | 0 | CategoryBo bo = from(im) |
61 | 0 | bos.add(bo); |
62 | |
} |
63 | 0 | return Collections.unmodifiableList(bos) |
64 | |
} |
65 | |
} |