001/** 002 * Copyright 2005-2013 The Kuali Foundation 003 * 004 * Licensed under the Educational Community License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.opensource.org/licenses/ecl2.php 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016package org.kuali.rice.krms.tree.node; 017 018import groovy.json.StringEscapeUtils; 019import org.apache.commons.lang.StringUtils; 020 021import java.io.Serializable; 022import java.util.List; 023 024/** 025 * @author Kuali Student Team 026 */ 027public class CompareTreeNode implements Serializable { 028 029 private String firstElement; 030 private List<String> firstElementItems; 031 private String secondElement; 032 private List<String> secondElementItems; 033 private String thirdElement; 034 private List<String> thirdElementItems; 035 private String fourthElement; 036 private List<String> fourthElementItems; 037 private String fithElement; 038 private List<String> fithElementItems; 039 040 public CompareTreeNode(){ 041 } 042 043 public CompareTreeNode(String... elements){ 044 for (int i = 0; i < elements.length; i++) { 045 switch (i) { 046 case 0: 047 this.firstElement = elements[0]; 048 break; 049 case 1: 050 this.secondElement = elements[1]; 051 break; 052 case 2: 053 this.thirdElement = elements[2]; 054 break; 055 case 3: 056 this.fourthElement= elements[3]; 057 break; 058 case 4: 059 this.fithElement = elements[4]; 060 break; 061 } 062 } 063 } 064 065 public String getFirstElement() { 066 if((this.firstElement == null) || (this.firstElement.isEmpty())){ 067 return org.apache.commons.lang.StringEscapeUtils.escapeHtml(" "); 068 } 069 return firstElement; 070 } 071 072 public void setFirstElement(String firstElement) { 073 this.firstElement = firstElement; 074 } 075 076 public List<String> getFirstElementItems() { 077 return firstElementItems; 078 } 079 080 public void setFirstElementItems(List<String> firstElementItems) { 081 this.firstElementItems = firstElementItems; 082 } 083 084 public String getSecondElement() { 085 if((this.secondElement == null) || (this.secondElement.isEmpty())){ 086 return org.apache.commons.lang.StringEscapeUtils.escapeHtml(" "); 087 } 088 return secondElement; 089 } 090 091 public void setSecondElement(String secondElement) { 092 this.secondElement = secondElement; 093 } 094 095 public List<String> getSecondElementItems() { 096 return secondElementItems; 097 } 098 099 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}