001: /*
002: * Copyright 2002-2005 the original author or authors.
003: *
004: * Licensed under the Apache 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.apache.org/licenses/LICENSE-2.0
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: */
016:
017: package com.tctest.spring.bean;
018:
019: import java.util.ArrayList;
020: import java.util.Collection;
021: import java.util.HashMap;
022: import java.util.List;
023: import java.util.Map;
024: import java.util.Set;
025: import java.util.SortedSet;
026: import java.util.TreeSet;
027:
028: /**
029: * @author Juergen Hoeller
030: * @since 11.11.2003
031: */
032: public class IndexedTestBean {
033:
034: private TestBean[] array;
035:
036: private List list;
037:
038: private SortedSet sortedSet;
039:
040: private Set set;
041:
042: private Collection collection;
043:
044: private Map map;
045:
046: public IndexedTestBean() {
047: this (true);
048: }
049:
050: public IndexedTestBean(boolean populate) {
051: if (populate) {
052: populate();
053: }
054: }
055:
056: public void populate() {
057: TestBean tb0 = new TestBean("name0", 0);
058: TestBean tb1 = new TestBean("name1", 0);
059: TestBean tb2 = new TestBean("name2", 0);
060: TestBean tb3 = new TestBean("name3", 0);
061: TestBean tb4 = new TestBean("name4", 0);
062: TestBean tb5 = new TestBean("name5", 0);
063: TestBean tb6 = new TestBean("name6", 0);
064: TestBean tb7 = new TestBean("name7", 0);
065: TestBean tbX = new TestBean("nameX", 0);
066: TestBean tbY = new TestBean("nameY", 0);
067: this .array = new TestBean[] { tb0, tb1 };
068: this .list = new ArrayList();
069: this .list.add(tb2);
070: this .list.add(tb3);
071: this .set = new TreeSet();
072: this .set.add(tb6);
073: this .set.add(tb7);
074: this .map = new HashMap();
075: this .map.put("key1", tb4);
076: this .map.put("key2", tb5);
077: this .map.put("key.3", tb5);
078: List list = new ArrayList();
079: list.add(tbX);
080: list.add(tbY);
081: this .map.put("key4", list);
082: }
083:
084: public TestBean[] getArray() {
085: return array;
086: }
087:
088: public void setArray(TestBean[] array) {
089: this .array = array;
090: }
091:
092: public List getList() {
093: return list;
094: }
095:
096: public void setList(List list) {
097: this .list = list;
098: }
099:
100: public SortedSet getSortedSet() {
101: return sortedSet;
102: }
103:
104: public void setSortedSet(SortedSet sortedSet) {
105: this .sortedSet = sortedSet;
106: }
107:
108: public Set getSet() {
109: return set;
110: }
111:
112: public void setSet(Set set) {
113: this .set = set;
114: }
115:
116: public Collection getCollection() {
117: return collection;
118: }
119:
120: public void setCollection(Collection collection) {
121: this .collection = collection;
122: }
123:
124: public Map getMap() {
125: return map;
126: }
127:
128: public void setMap(Map map) {
129: this.map = map;
130: }
131:
132: }
|