001/**
002 * Copyright 2005-2015 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 edu.sampleu.demo.kitchensink;
017
018import java.io.Serializable;
019import java.util.ArrayList;
020import java.util.Arrays;
021import java.util.HashMap;
022import java.util.List;
023import java.util.Map;
024import java.util.Random;
025
026/**
027 * For test view purposes only
028 *
029 * @author Kuali Rice Team (rice.collab@kuali.org)
030 */
031public class UITestObject implements Serializable {
032    private static final long serialVersionUID = -7525378097732916411L;
033
034    private String field1;
035    private String field2;
036    private String field3;
037    private String field4;
038    private boolean bfield;
039    private boolean bfield2;
040    private List<String> stringList = Arrays.asList("String1", "String2", "String3");
041
042    private UITestObject innerObject;
043
044    private Map<String, Object> remoteFieldValuesMap;
045
046    private List<UITestObject> subList = new ArrayList<UITestObject>();
047
048    public UITestObject() {
049        remoteFieldValuesMap = new HashMap<String, Object>();
050        remoteFieldValuesMap.put("remoteField1", "Apple");
051        remoteFieldValuesMap.put("remoteField2", "Banana");
052        remoteFieldValuesMap.put("remoteField3", true);
053        remoteFieldValuesMap.put("remoteField4", "Fruit");
054        Random r = new Random();
055        bfield2 = r.nextBoolean();
056    }
057
058    public UITestObject(String field1, String field2, String field3, String field4) {
059        this.field1 = field1;
060        this.field2 = field2;
061        this.field3 = field3;
062        this.field4 = field4;
063
064        Random r = new Random();
065        bfield2 = r.nextBoolean();
066
067        remoteFieldValuesMap = new HashMap<String, Object>();
068        remoteFieldValuesMap.put("remoteField1", "Apple");
069        remoteFieldValuesMap.put("remoteField2", "Banana");
070        remoteFieldValuesMap.put("remoteField3", true);
071        remoteFieldValuesMap.put("remoteField4", "Fruit");
072
073    }
074
075    public UITestObject(String field1, String field2, String field3, String field4, UITestObject innerObject) {
076        this(field1,field2,field3,field4);
077
078        this.innerObject = innerObject;
079    }
080
081    /**
082     * @return the field1
083     */
084    public String getField1() {
085        return this.field1;
086    }
087
088    /**
089     * @param field1 the field1 to set
090     */
091    public void setField1(String field1) {
092        this.field1 = field1;
093    }
094
095    /**
096     * @return the field2
097     */
098    public String getField2() {
099        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}