View Javadoc
1   package org.kuali.kpme.edo.group;
2   
3   import org.kuali.kpme.core.bo.HrBusinessObject;
4   import org.kuali.kpme.edo.api.group.EdoGroupDefinition;
5   import org.kuali.kpme.edo.api.group.EdoGroupDefinitionContract;
6   import org.kuali.rice.core.api.mo.ModelObjectUtils;
7   
8   import com.google.common.collect.ImmutableMap;
9   
10  /**
11   * $HeadURL$
12   * $Revision$
13   * Created with IntelliJ IDEA.
14   * User: bradleyt
15   * Date: 12/18/13
16   * Time: 10:27 AM
17   */
18  public class EdoGroupDefinitionBo extends HrBusinessObject implements EdoGroupDefinitionContract {
19  
20  	private static final long serialVersionUID = 7089330958890991138L;
21  	
22  	static class KeyFields {
23  		private static final String EDO_WORKFLOW_ID = "edoWorkflowId";
24  		private static final String WORKFLOW_LEVEL = "workflowLevel";
25  		private static final String DOSSIER_TYPE = "dossierType";
26  	}
27  
28  	private String edoGroupId;
29      private String edoWorkflowId;
30      private String workflowLevel;
31      private String dossierType;
32      private String workflowType;
33      private String kimTypeName;
34      private String kimRoleName;
35  
36      @Override
37  	public boolean isActive() {
38  		return super.isActive();
39  	}
40  
41  	@Override
42  	public void setActive(boolean active) {
43  		super.setActive(active);
44  	}
45  
46  	@Override
47  	public String getObjectId() {
48  		return super.getObjectId();
49  	}
50  
51  	@Override
52  	public Long getVersionNumber() {
53  		return super.getVersionNumber();
54  	}
55  	
56      @Override
57  	public String getId() {
58  		return  getEdoGroupId();
59  	}
60      
61      @Override
62  	public void setId(String edoGroupId) {
63      	setEdoGroupId(edoGroupId);
64  	}
65      
66      @Override
67  	protected String getUniqueKey() {
68  		return getEdoGroupId();
69  	}
70      
71      @Override
72  	public ImmutableMap<String, Object> getBusinessKeyValuesMap() {
73  		return  new ImmutableMap.Builder<String, Object>()
74  				.put(KeyFields.EDO_WORKFLOW_ID, this.getEdoWorkflowId())
75  				.put(KeyFields.WORKFLOW_LEVEL, this.getWorkflowLevel())
76  				.put(KeyFields.DOSSIER_TYPE, this.getDossierType())
77  				.build();
78  	}
79      
80      public String getEdoGroupId() {
81          return edoGroupId;
82      }
83  
84      public void setEdoGroupId(String edoGroupId) {
85          this.edoGroupId = edoGroupId;
86      }
87  
88      public String getEdoWorkflowId() {
89          return edoWorkflowId;
90      }
91  
92      public void setEdoWorkflowId(String edoWorkflowId) {
93          this.edoWorkflowId = edoWorkflowId;
94      }
95  
96      public String getWorkflowLevel() {
97          return workflowLevel;
98      }
99  
100     public void setWorkflowLevel(String workflowLevel) {
101         this.workflowLevel = workflowLevel;
102     }
103 
104     public String getDossierType() {
105         return dossierType;
106     }
107 
108     public void setDossierType(String dossierType) {
109         this.dossierType = dossierType;
110     }
111 
112     public String getWorkflowType() {
113         return workflowType;
114     }
115 
116     public void setWorkflowType(String workflowType) {
117         this.workflowType = workflowType;
118     }
119 
120     public String getKimTypeName() {
121         return kimTypeName;
122     }
123 
124     public void setKimTypeName(String kimTypeName) {
125         this.kimTypeName = kimTypeName;
126     }
127 
128     public String getKimRoleName() {
129         return kimRoleName;
130     }
131 
132     public void setKimRoleName(String kimRoleName) {
133         this.kimRoleName = kimRoleName;
134     }
135     
136     public static EdoGroupDefinitionBo from(EdoGroupDefinition im) {
137         if (im == null) {
138             return null;
139         }
140         EdoGroupDefinitionBo egd = new EdoGroupDefinitionBo();
141         egd.setEdoGroupId(im.getEdoGroupId());
142         egd.setEdoWorkflowId(im.getEdoWorkflowId());
143         egd.setWorkflowLevel(im.getWorkflowLevel());
144         egd.setDossierType(im.getDossierType());
145         egd.setWorkflowType(im.getWorkflowType());
146         egd.setKimTypeName(im.getKimTypeName());        
147         egd.setKimRoleName(im.getKimRoleName());
148 
149         // finally copy over the common fields into egd from im
150         copyCommonFields(egd, im);
151      
152         return egd;
153     } 
154     
155     public static EdoGroupDefinition to(EdoGroupDefinitionBo bo) {
156         if (bo == null) {
157             return null;
158         }
159         return EdoGroupDefinition.Builder.create(bo).build();
160     }
161     
162     public static final ModelObjectUtils.Transformer<EdoGroupDefinitionBo, EdoGroupDefinition> toImmutable = new ModelObjectUtils.Transformer<EdoGroupDefinitionBo, EdoGroupDefinition>() {
163         public EdoGroupDefinition transform(EdoGroupDefinitionBo input) {
164             return EdoGroupDefinitionBo.to(input);
165         };
166     };
167             
168     public static final ModelObjectUtils.Transformer<EdoGroupDefinition, EdoGroupDefinitionBo> toBo = new ModelObjectUtils.Transformer<EdoGroupDefinition, EdoGroupDefinitionBo>() {
169         public EdoGroupDefinitionBo transform(EdoGroupDefinition input) {
170             return EdoGroupDefinitionBo.from(input);
171         };
172     };
173 }