View Javadoc
1   /**
2    * Copyright 2005-2016 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 edu.sampleu.demo.kitchensink;
17  
18  import java.io.Serializable;
19  import java.util.ArrayList;
20  import java.util.Arrays;
21  import java.util.HashMap;
22  import java.util.List;
23  import java.util.Map;
24  import java.util.Random;
25  
26  /**
27   * For test view purposes only
28   *
29   * @author Kuali Rice Team (rice.collab@kuali.org)
30   */
31  public class UITestObject implements Serializable {
32      private static final long serialVersionUID = -7525378097732916411L;
33  
34      private String field1;
35      private String field2;
36      private String field3;
37      private String field4;
38      private boolean bfield;
39      private boolean bfield2;
40      private List<String> stringList = Arrays.asList("String1", "String2", "String3");
41  
42      private UITestObject innerObject;
43  
44      private Map<String, Object> remoteFieldValuesMap;
45  
46      private List<UITestObject> subList = new ArrayList<UITestObject>();
47  
48      public UITestObject() {
49          remoteFieldValuesMap = new HashMap<String, Object>();
50          remoteFieldValuesMap.put("remoteField1", "Apple");
51          remoteFieldValuesMap.put("remoteField2", "Banana");
52          remoteFieldValuesMap.put("remoteField3", true);
53          remoteFieldValuesMap.put("remoteField4", "Fruit");
54          Random r = new Random();
55          bfield2 = r.nextBoolean();
56      }
57  
58      public UITestObject(String field1, String field2, String field3, String field4) {
59          this.field1 = field1;
60          this.field2 = field2;
61          this.field3 = field3;
62          this.field4 = field4;
63  
64          Random r = new Random();
65          bfield2 = r.nextBoolean();
66  
67          remoteFieldValuesMap = new HashMap<String, Object>();
68          remoteFieldValuesMap.put("remoteField1", "Apple");
69          remoteFieldValuesMap.put("remoteField2", "Banana");
70          remoteFieldValuesMap.put("remoteField3", true);
71          remoteFieldValuesMap.put("remoteField4", "Fruit");
72  
73      }
74  
75      public UITestObject(String field1, String field2, String field3, String field4, UITestObject innerObject) {
76          this(field1,field2,field3,field4);
77  
78          this.innerObject = innerObject;
79      }
80  
81      /**
82       * @return the field1
83       */
84      public String getField1() {
85          return this.field1;
86      }
87  
88      /**
89       * @param field1 the field1 to set
90       */
91      public void setField1(String field1) {
92          this.field1 = field1;
93      }
94  
95      /**
96       * @return the field2
97       */
98      public String getField2() {
99          return this.field2;
100     }
101 
102     /**
103      * @param field2 the field2 to set
104      */
105     public void setField2(String field2) {
106         this.field2 = field2;
107     }
108 
109     /**
110      * @return the field3
111      */
112     public String getField3() {
113         return this.field3;
114     }
115 
116     /**
117      * @param field3 the field3 to set
118      */
119     public void setField3(String field3) {
120         this.field3 = field3;
121     }
122 
123     /**
124      * @return the field4
125      */
126     public String getField4() {
127         return this.field4;
128     }
129 
130     /**
131      * @param field4 the field4 to set
132      */
133     public void setField4(String field4) {
134         this.field4 = field4;
135     }
136 
137     /**
138      * @param subList the subList to set
139      */
140     public void setSubList(List<UITestObject> subList) {
141         this.subList = subList;
142     }
143 
144     /**
145      * @return the subList
146      */
147     public List<UITestObject> getSubList() {
148         return subList;
149     }
150 
151     public Map<String, Object> getRemoteFieldValuesMap() {
152         return remoteFieldValuesMap;
153     }
154 
155     public void setRemoteFieldValuesMap(Map<String, Object> remoteFieldValuesMap) {
156         this.remoteFieldValuesMap = remoteFieldValuesMap;
157     }
158 
159     /**
160      * boolean field
161      *
162      * @return bField
163      */
164     public boolean isBfield() {
165         return bfield;
166     }
167 
168     /**
169      * @param bfield boolean field
170      */
171     public void setBfield(boolean bfield) {
172         this.bfield = bfield;
173     }
174 
175     public boolean isBfield2() {
176         return bfield2;
177     }
178 
179     public void setBfield2(boolean bfield2) {
180         this.bfield2 = bfield2;
181     }
182 
183     @Override
184     public String toString() {
185 
186         return "" + field1 + field2 + field3 + field4;
187     }
188 
189     public List<String> getStringList() {
190         return stringList;
191     }
192 
193     public void setStringList(List<String> stringList) {
194         this.stringList = stringList;
195     }
196 
197     public UITestObject getInnerObject() {
198         return innerObject;
199     }
200 
201     public void setInnerObject(UITestObject innerObject) {
202         this.innerObject = innerObject;
203     }
204 }