View Javadoc

1   /**
2    * Copyright 2005-2013 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.rice.krms.tree.node;
17  
18  import groovy.json.StringEscapeUtils;
19  import org.apache.commons.lang.StringUtils;
20  
21  import java.io.Serializable;
22  import java.util.List;
23  
24  /**
25   * @author Kuali Student Team
26   */
27  public class CompareTreeNode implements Serializable {
28  
29      private String firstElement;
30      private List<String> firstElementItems;
31      private String secondElement;
32      private List<String> secondElementItems;
33      private String thirdElement;
34      private List<String> thirdElementItems;
35      private String fourthElement;
36      private List<String> fourthElementItems;
37      private String fithElement;
38      private List<String> fithElementItems;
39  
40      public CompareTreeNode(){
41      }
42  
43      public CompareTreeNode(String... elements){
44          for (int i = 0; i < elements.length; i++) {
45              switch (i) {
46                  case 0:
47                      this.firstElement = elements[0];
48                      break;
49                  case 1:
50                      this.secondElement = elements[1];
51                      break;
52                  case 2:
53                      this.thirdElement = elements[2];
54                      break;
55                  case 3:
56                      this.fourthElement= elements[3];
57                      break;
58                  case 4:
59                      this.fithElement = elements[4];
60                      break;
61              }
62          }
63      }
64  
65      public String getFirstElement() {
66          if((this.firstElement == null) || (this.firstElement.isEmpty())){
67              return org.apache.commons.lang.StringEscapeUtils.escapeHtml(" ");
68          }
69          return firstElement;
70      }
71  
72      public void setFirstElement(String firstElement) {
73          this.firstElement = firstElement;
74      }
75  
76      public List<String> getFirstElementItems() {
77          return firstElementItems;
78      }
79  
80      public void setFirstElementItems(List<String> firstElementItems) {
81          this.firstElementItems = firstElementItems;
82      }
83  
84      public String getSecondElement() {
85          if((this.secondElement == null) || (this.secondElement.isEmpty())){
86              return org.apache.commons.lang.StringEscapeUtils.escapeHtml(" ");
87          }
88          return secondElement;
89      }
90  
91      public void setSecondElement(String secondElement) {
92          this.secondElement = secondElement;
93      }
94  
95      public List<String> getSecondElementItems() {
96          return secondElementItems;
97      }
98  
99      public void setSecondElementItems(List<String> secondElementItems) {
100         this.secondElementItems = secondElementItems;
101     }
102 
103     public String getThirdElement() {
104         if((this.thirdElement == null) || (this.thirdElement.isEmpty())){
105             return org.apache.commons.lang.StringEscapeUtils.escapeHtml(" ");
106         }
107         return thirdElement;
108     }
109 
110     public void setThirdElement(String thirdElement) {
111         this.thirdElement = thirdElement;
112     }
113 
114     public List<String> getThirdElementItems() {
115         return thirdElementItems;
116     }
117 
118     public void setThirdElementItems(List<String> thirdElementItems) {
119         this.thirdElementItems = thirdElementItems;
120     }
121 
122     public String getFourthElement() {
123         if((this.fourthElement == null) || (this.fourthElement.isEmpty())){
124             return org.apache.commons.lang.StringEscapeUtils.escapeHtml(" ");
125         }
126         return fourthElement;
127     }
128 
129     public void setFourthElement(String fourthElement) {
130         this.fourthElement = fourthElement;
131     }
132 
133     public List<String> getFourthElementItems() {
134         return fourthElementItems;
135     }
136 
137     public void setFourthElementItems(List<String> fourthElementItems) {
138         this.fourthElementItems = fourthElementItems;
139     }
140 
141     public String getFithElement() {
142         if((this.fithElement == null) || (this.fithElement.isEmpty())){
143             return org.apache.commons.lang.StringEscapeUtils.escapeHtml(" ");
144         }
145         return fithElement;
146     }
147 
148     public void setFithElement(String fithElement) {
149         this.fithElement = fithElement;
150     }
151 
152     public List<String> getFithElementItems() {
153         return fithElementItems;
154     }
155 
156     public void setFithElementItems(List<String> fithElementItems) {
157         this.fithElementItems = fithElementItems;
158     }
159 }