View Javadoc

1   /*
2    * Copyright 2009 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 1.0 (the
5    * "License"); you may not use this file except in compliance with the
6    * License. You may obtain a copy of the License at
7    *
8    * http://www.opensource.org/licenses/ecl1.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
13   * implied.  See the License for the specific language governing
14   * permissions and limitations under the License.
15   */
16  
17  package org.kuali.student.r2.common.dto;
18  
19  import java.io.Serializable;
20  import java.util.ArrayList;
21  import java.util.Collections;
22  import java.util.List;
23  
24  import javax.xml.bind.annotation.XmlAccessType;
25  import javax.xml.bind.annotation.XmlAccessorType;
26  import javax.xml.bind.annotation.XmlAnyElement;
27  import javax.xml.bind.annotation.XmlElement;
28  import javax.xml.bind.annotation.XmlElementWrapper;
29  import javax.xml.bind.annotation.XmlType;
30  
31  import org.kuali.student.r2.common.infc.Comparison;
32  //import org.w3c.dom.Element;
33  
34  @XmlAccessorType(XmlAccessType.FIELD)
35  @XmlType(name = "ComparisonInfo", propOrder = {
36                  "fieldKey", "operator", "values", "isIgnoreCase" , "_futureElements" }) 
37  
38  public class ComparisonInfo 
39      implements Comparison, Serializable {
40  
41      private static final long serialVersionUID = 1L;
42  
43      @XmlElement
44      private String fieldKey;
45      
46      @XmlElement
47      private String operator;
48      
49      @XmlElement
50      private List<String> values;
51      
52      @XmlElement
53      private boolean isIgnoreCase;
54  
55      
56      @XmlAnyElement
57      private List<Object> _futureElements;
58  
59  
60      /**
61       * Constructs a new ComparisonInfo.
62       */
63      public ComparisonInfo() {
64      }
65  
66      /**
67       * Constructs a new ComparisonInfo from another Comparison.
68       *
69       * @param comparison the comparison to copy
70       */
71      public ComparisonInfo(Comparison comparison) {
72          this.fieldKey = comparison.getFieldKey();
73          this.operator = comparison.getOperator();
74  
75          if (comparison.getValues() != null) {
76              this.values = Collections.unmodifiableList(comparison.getValues());
77          }
78  
79          this.isIgnoreCase = comparison.getIsIgnoreCase();
80      }
81  
82      @Override
83      public String getFieldKey() {
84          return fieldKey;
85      }
86  
87      public void setFieldKey(String fieldKey) {
88          this.fieldKey = fieldKey;
89      }
90  
91      @Override
92      public String getOperator() {
93          return operator;
94      }
95  
96      public void setOperator(String operator) {
97          this.operator = operator;
98      }
99  
100     @Override
101     public List<String> getValues() {
102         return values;
103     }
104 
105     public void setValues(List<String> values) {
106         this.values = new ArrayList<String>(values);
107     }
108 
109     @Override
110     public Boolean getIsIgnoreCase() {
111         return this.isIgnoreCase;
112     }
113 
114     public void setIgnoreCase(Boolean ignoreCase) {
115         this.isIgnoreCase = ignoreCase;
116     }
117 }