View Javadoc
1   package org.kuali.ole.batch.bo;
2   
3   import org.kuali.rice.krad.bo.PersistableBusinessObjectBase;
4   
5   /**
6    * Created with IntelliJ IDEA.
7    * User: adityas
8    * Date: 7/6/13
9    * Time: 4:30 PM
10   * To change this template use File | Settings | File Templates.
11   */
12  public class OLEBatchProcessProfileDataMappingOptionsBo  extends PersistableBusinessObjectBase implements Comparable<OLEBatchProcessProfileDataMappingOptionsBo>{
13  
14      private String oleBatchProcessProfileDataMappingOptionId;
15      private String oleBatchProcessDataMapId;
16      private String fileType;
17      private String dataType;
18      private String dataTypeDestinationField;
19      private String sourceField;
20      private String sourceFieldText;
21      private String sourceFieldValue;
22      private String destinationField;
23      private String destinationFieldText;
24      private String destinationFieldValue;
25      private int priority;
26      private boolean lookUp;
27      private OLEBatchProcessProfileMappingOptionsBo oleBatchProcessProfileMappingOptionsBo;
28      public String getDataType() {
29          return dataType;
30      }
31  
32      public void setDataType(String dataType) {
33          this.dataType = dataType;
34      }
35      public String getOleBatchProcessDataMapId() {
36          return oleBatchProcessDataMapId;
37      }
38  
39      public void setOleBatchProcessDataMapId(String oleBatchProcessDataMapId) {
40          this.oleBatchProcessDataMapId = oleBatchProcessDataMapId;
41      }
42  
43      public String getOleBatchProcessProfileDataMappingOptionId() {
44          return oleBatchProcessProfileDataMappingOptionId;
45      }
46  
47      public void setOleBatchProcessProfileDataMappingOptionId(String oleBatchProcessProfileDataMappingOptionId) {
48          this.oleBatchProcessProfileDataMappingOptionId = oleBatchProcessProfileDataMappingOptionId;
49      }
50  
51      public OLEBatchProcessProfileMappingOptionsBo getOleBatchProcessProfileMappingOptionsBo() {
52          return oleBatchProcessProfileMappingOptionsBo;
53      }
54  
55      public void setOleBatchProcessProfileMappingOptionsBo(OLEBatchProcessProfileMappingOptionsBo oleBatchProcessProfileMappingOptionsBo) {
56          this.oleBatchProcessProfileMappingOptionsBo = oleBatchProcessProfileMappingOptionsBo;
57      }
58  
59      public String getFileType() {
60          return fileType;
61      }
62  
63      public void setFileType(String fileType) {
64          this.fileType = fileType;
65      }
66  
67      public String getSourceField() {
68          if(sourceField==null || sourceField.isEmpty())
69          {
70              if(sourceFieldText!=null && !sourceFieldText.isEmpty()){
71                  return sourceFieldText;
72              }
73          }
74          return sourceField;
75      }
76  
77      public void setSourceField(String sourceField) {
78          this.sourceField = sourceField;
79      }
80  
81      public String getSourceFieldValue() {
82          return sourceFieldValue;
83      }
84  
85      public void setSourceFieldValue(String sourceFieldValue) {
86          this.sourceFieldValue = sourceFieldValue;
87      }
88  
89      public String getDestinationField() {
90          if(destinationField==null || destinationField.isEmpty())
91          {
92              if(destinationFieldText!=null && !destinationFieldText.isEmpty()){
93                  return destinationFieldText;
94              }
95          }
96          return destinationField;
97      }
98  
99      public void setDestinationField(String destinationField) {
100         this.destinationField = destinationField;
101     }
102 
103     public String getDestinationFieldValue() {
104         return destinationFieldValue;
105     }
106 
107     public void setDestinationFieldValue(String destinationFieldValue) {
108         this.destinationFieldValue = destinationFieldValue;
109     }
110 
111     public int getPriority() {
112         return priority;
113     }
114 
115     public void setPriority(int priority) {
116         this.priority = priority;
117     }
118 
119     public boolean isLookUp() {
120         return lookUp;
121     }
122 
123     public void setLookUp(boolean lookUp) {
124         this.lookUp = lookUp;
125     }
126 
127     public String getSourceFieldText() {
128         return sourceFieldText;
129     }
130 
131     public void setSourceFieldText(String sourceFieldText) {
132         this.sourceFieldText = sourceFieldText;
133 
134         if(sourceField==null || sourceField.isEmpty())
135         {
136             if(sourceFieldText!=null && !sourceFieldText.isEmpty()){
137                 this.sourceField= sourceFieldText;
138             }
139         }
140     }
141 
142     public String getDestinationFieldText() {
143         return destinationFieldText;
144     }
145 
146     public void setDestinationFieldText(String destinationFieldText) {
147         this.destinationFieldText = destinationFieldText;
148 
149         if(destinationField==null || destinationField.isEmpty())
150         {
151             if(destinationFieldText!=null && !destinationFieldText.isEmpty()){
152                 this.destinationField= destinationFieldText;
153             }
154         }
155     }
156 
157     public String getDataTypeDestinationField() {
158         return dataTypeDestinationField;
159     }
160 
161     public void setDataTypeDestinationField(String dataTypeDestinationField) {
162         this.dataTypeDestinationField = dataTypeDestinationField;
163     }
164 
165     @Override
166     public int compareTo(OLEBatchProcessProfileDataMappingOptionsBo o) {
167 
168         if(this.getDataTypeDestinationField().equals(o.getDataTypeDestinationField())) {
169             if(this.getDestinationField().equals(o.getDestinationField())) {
170                return this.getPriority() - o.getPriority();
171             }
172             else {
173                 return this.getDestinationField().compareTo(o.getDestinationField());
174             }
175         }
176         else {
177             return this.getDataTypeDestinationField().compareTo(o.getDataTypeDestinationField());
178         }
179 
180     }
181 }