1 | |
package org.kuali.rice.krms.impl.repository |
2 | |
|
3 | |
import org.kuali.rice.krad.bo.PersistableBusinessObjectBase |
4 | |
|
5 | |
import org.kuali.rice.krms.api.repository.term.TermDefinition; |
6 | |
import org.kuali.rice.krms.api.repository.term.TermDefinitionContract; |
7 | |
|
8 | |
|
9 | |
public class TermBo extends PersistableBusinessObjectBase implements TermDefinitionContract { |
10 | |
|
11 | |
def String id |
12 | |
def String specificationId |
13 | |
|
14 | |
def TermSpecificationBo specification |
15 | |
def List<TermParameterBo> parameters |
16 | |
|
17 | |
|
18 | |
|
19 | |
|
20 | |
|
21 | |
|
22 | |
static TermDefinition to(TermBo bo) { |
23 | 0 | if (bo == null) { return null } |
24 | 0 | return org.kuali.rice.krms.api.repository.term.TermDefinition.Builder.create(bo).build() |
25 | |
} |
26 | |
|
27 | |
|
28 | |
|
29 | |
|
30 | |
|
31 | |
|
32 | |
static TermBo from(TermDefinition im) { |
33 | 0 | if (im == null) { return null } |
34 | |
|
35 | 0 | TermBo bo = new TermBo() |
36 | 0 | bo.id = im.id |
37 | 0 | bo.specificationId = im.specification.id |
38 | 0 | bo.specification = TermSpecificationBo.from(im.specification) |
39 | 0 | bo.parameters = new ArrayList<TermParameterBo>() |
40 | 0 | for (parm in im.parameters){ |
41 | 0 | bo.parameters.add ( TermParameterBo.from(parm) ) |
42 | |
} |
43 | 0 | bo.versionNumber = im.versionNumber |
44 | 0 | return bo |
45 | |
} |
46 | |
|
47 | |
public TermSpecificationBo getSpecification(){ |
48 | 0 | return specification |
49 | |
} |
50 | |
|
51 | |
public List<TermParameterBo> getParameters(){ |
52 | 0 | return parameters |
53 | |
} |
54 | |
|
55 | |
} |