View Javadoc
1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one or more
3    * contributor license agreements.  See the NOTICE file distributed with
4    * this work for additional information regarding copyright ownership.
5    * The ASF licenses this file to You under the Apache License, Version 2.0
6    * (the "License"); you may not use this file except in compliance with
7    * the License.  You may obtain a copy of the License at
8    *
9    *      http://www.apache.org/licenses/LICENSE-2.0
10   *
11   * Unless required by applicable law or agreed to in writing, software
12   * distributed under the License is distributed on an "AS IS" BASIS,
13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   * See the License for the specific language governing permissions and
15   * limitations under the License.
16   */
17  
18  package org.apache.commons.beanutils;
19  
20  import java.util.ArrayList;
21  import java.util.List;
22  
23  /**
24   * Indexed Properties Test bean for JUnit tests for the "beanutils" component.
25   *
26   * @version $Id$
27   */
28  public class IndexedTestBean {
29  
30      private String[] stringArray;
31      private List<String> stringList;
32      private ArrayList<Object> arrayList;
33  
34  
35      // ----------------------------------------------------------- Constructors
36  
37      /**
38       * Default Constructor.
39       */
40      public IndexedTestBean() {
41      }
42  
43      /**
44       * Getter for the String[] property.
45       */
46      public String[] getStringArray() {
47          return stringArray;
48      }
49  
50      /**
51       * Setter for the String[] property.
52       */
53      public void setStringArray(final String[] stringArray) {
54          this.stringArray = stringArray;
55      }
56  
57      /**
58       * Indexed Getter for the String[] property.
59       */
60      public String getStringArray(final int index) {
61          return stringArray[index];
62      }
63  
64      /**
65       * Indexed Setter for the String[] property.
66       */
67      public void setStringArray(final int index, final String value) {
68          stringArray[index] = value;
69      }
70  
71      /**
72       * Getter for the java.util.List property.
73       */
74      public List<String> getStringList() {
75          return stringList;
76      }
77  
78      /**
79       * Setter for the java.util.List property.
80       */
81      public void setStringList(final List<String> stringList) {
82          this.stringList = stringList;
83      }
84  
85      /**
86       * Indexed Getter for the java.util.List property.
87       */
88      public String getStringList(final int index) {
89          return stringList.get(index);
90      }
91  
92      /**
93       * Indexed Setter for the java.util.List property.
94       */
95      public void setStringList(final int index, final String value) {
96          stringList.add(index, value);
97      }
98  
99      /**
100      * Getter for the java.util.ArrayList property.
101      */
102     public ArrayList<Object> getArrayList() {
103         return arrayList;
104     }
105 
106     /**
107      * Setter for the java.util.ArrayList property.
108      */
109     public void setArrayList(final ArrayList<Object> arrayList) {
110         this.arrayList = arrayList;
111     }
112 
113     /**
114      * Indexed Getter for the java.util.ArrayList property.
115      */
116     public Object getArrayList(final int index) {
117         return arrayList.get(index);
118     }
119 
120     /**
121      * Indexed Setter for the java.util.ArrayList property.
122      */
123     public void setArrayList(final int index, final Object value) {
124         arrayList.add(index, value);
125     }
126 
127 }