1 | |
package org.kuali.rice.krms.impl.repository |
2 | |
|
3 | |
import org.kuali.rice.kns.bo.Inactivateable |
4 | |
import org.kuali.rice.kns.bo.PersistableBusinessObjectBase |
5 | |
|
6 | |
import org.kuali.rice.krms.api.repository.function.FunctionDefinition |
7 | |
import org.kuali.rice.krms.api.repository.function.FunctionDefinitionContract |
8 | |
|
9 | |
|
10 | |
public class FunctionBo extends PersistableBusinessObjectBase implements Inactivateable, FunctionDefinitionContract { |
11 | |
|
12 | |
def String id |
13 | |
def String namespace |
14 | |
def String name |
15 | |
def String description |
16 | |
def String returnType |
17 | |
def String typeId |
18 | |
def boolean active |
19 | |
|
20 | |
def List<FunctionParameterBo> parameters |
21 | |
|
22 | |
|
23 | |
|
24 | |
|
25 | |
|
26 | |
|
27 | |
static FunctionDefinition to(FunctionBo bo) { |
28 | 0 | if (bo == null) { return null } |
29 | 0 | return org.kuali.rice.krms.api.repository.function.FunctionDefinition.Builder.create(bo).build() |
30 | |
} |
31 | |
|
32 | |
|
33 | |
|
34 | |
|
35 | |
|
36 | |
|
37 | |
static FunctionBo from(FunctionDefinition im) { |
38 | 0 | if (im == null) { return null } |
39 | |
|
40 | 0 | FunctionBo bo = new FunctionBo() |
41 | 0 | bo.id = im.id |
42 | 0 | bo.namespace = im.namespace |
43 | 0 | bo.name = im.name |
44 | 0 | bo.description = im.description |
45 | 0 | bo.returnType = im.returnType |
46 | 0 | bo.typeId = im.typeId |
47 | 0 | bo.active = im.active |
48 | 0 | bo.versionNumber = im.versionNumber |
49 | 0 | bo.parameters = new ArrayList<FunctionParameterBo>() |
50 | 0 | for (parm in im.parameters){ |
51 | 0 | bo.parameters.add( FunctionParameterBo.from(parm) ) |
52 | |
} |
53 | 0 | bo.versionNumber = im.versionNumber |
54 | 0 | return bo |
55 | |
} |
56 | |
|
57 | |
|
58 | |
} |