1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.kpme.pm.classification.flag;
17
18 import java.util.List;
19
20 import org.kuali.kpme.pm.api.classification.flag.ClassificationFlag;
21 import org.kuali.kpme.pm.api.classification.flag.ClassificationFlagContract;
22 import org.kuali.kpme.pm.classification.ClassificationBo;
23 import org.kuali.kpme.pm.classification.ClassificationDerived;
24 import org.kuali.rice.core.api.mo.ModelObjectUtils;
25
26 public class ClassificationFlagBo extends ClassificationDerived implements ClassificationFlagContract {
27
28 private static final long serialVersionUID = -6195340711898188423L;
29
30 private String pmFlagId;
31 private String category;
32
33 private List<String> names;
34
35 public String getPmFlagId() {
36 return pmFlagId;
37 }
38 public void setPmFlagId(String pmFlagId) {
39 this.pmFlagId = pmFlagId;
40 }
41 public String getCategory() {
42 return category;
43 }
44 public void setCategory(String category) {
45 this.category = category;
46 }
47 public List<String> getNames() {
48 return names;
49 }
50 public void setNames(List<String> names) {
51 this.names = names;
52 }
53 @Override
54 public String getId() {
55 return this.getPmFlagId();
56 }
57 @Override
58 public void setId(String id) {
59 this.setPmFlagId(id);
60 }
61
62 public static ClassificationFlagBo from(ClassificationFlag im) {
63 if (im == null) {
64 return null;
65 }
66 ClassificationFlagBo classificationFlagBo = new ClassificationFlagBo();
67
68
69 classificationFlagBo.setPmFlagId(im.getPmFlagId());
70 classificationFlagBo.setCategory(im.getCategory());
71 classificationFlagBo.setNames(im.getNames());
72 classificationFlagBo.setPmPositionClassId(im.getPmPositionClassId());
73 classificationFlagBo.setVersionNumber(im.getVersionNumber());
74 classificationFlagBo.setObjectId(im.getObjectId());
75
76 return classificationFlagBo;
77 }
78
79 public static ClassificationFlag to(ClassificationFlagBo bo) {
80 if (bo == null) {
81 return null;
82 }
83 return ClassificationFlag.Builder.create(bo).build();
84 }
85
86 public static final ModelObjectUtils.Transformer<ClassificationFlagBo, ClassificationFlag> toImmutable = new ModelObjectUtils.Transformer<ClassificationFlagBo, ClassificationFlag>() {
87 public ClassificationFlag transform(ClassificationFlagBo input) {
88 return ClassificationFlagBo.to(input);
89 };
90 };
91
92 public static final ModelObjectUtils.Transformer<ClassificationFlag, ClassificationFlagBo> toBo = new ModelObjectUtils.Transformer<ClassificationFlag, ClassificationFlagBo>() {
93 public ClassificationFlagBo transform(ClassificationFlag input) {
94 return ClassificationFlagBo.from(input);
95 };
96 };
97
98
99 }