View Javadoc
1   /**
2    * Copyright 2004-2015 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.opensource.org/licenses/ecl2.php
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
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  	//private String names;
33  	private List<String> names; // KPME-2360/2958
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  }