View Javadoc
1   package org.codehaus.plexus.component.configurator;
2   
3   /*
4    * The MIT License
5    *
6    * Copyright (c) 2004, The Codehaus
7    *
8    * Permission is hereby granted, free of charge, to any person obtaining a copy of
9    * this software and associated documentation files (the "Software"), to deal in
10   * the Software without restriction, including without limitation the rights to
11   * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
12   * of the Software, and to permit persons to whom the Software is furnished to do
13   * so, subject to the following conditions:
14   *
15   * The above copyright notice and this permission notice shall be included in all
16   * copies or substantial portions of the Software.
17   *
18   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24   * SOFTWARE.
25   */
26  
27  import java.util.List;
28  
29  import org.codehaus.plexus.configuration.PlexusConfiguration;
30  
31  /**
32   *
33   *
34   * @author Jason van Zyl
35   *
36   */
37  public class ComponentWithSetters {
38      private int intValueVariable;
39      private float floatValueVariable;
40      private long longValueVariable;
41      private double doubleValueVariable;
42      private String stringValueVariable;
43      private List importantThingsVariable;
44      private PlexusConfiguration configurationVariable;
45  
46      public int getIntValue() {
47          return intValueVariable;
48      }
49  
50      public float getFloatValue() {
51          return floatValueVariable;
52      }
53  
54      public long getLongValue() {
55          return longValueVariable;
56      }
57  
58      public double getDoubleValue() {
59          return doubleValueVariable;
60      }
61  
62      public String getStringValue() {
63          return stringValueVariable;
64      }
65  
66      public List getImportantThings() {
67          return importantThingsVariable;
68      }
69  
70      public PlexusConfiguration getConfiguration() {
71          return configurationVariable;
72      }
73  
74      // ----------------------------------------------------------------------
75      // setters
76      // ----------------------------------------------------------------------
77  
78      boolean intValueSet;
79      boolean floatValueSet;
80      boolean longValueSet;
81      boolean doubleValueSet;
82      boolean stringValueSet;
83      boolean importantThingsValueSet;
84      boolean configurationValueSet;
85  
86      public void setIntValue(int intValue) {
87          this.intValueVariable = intValue;
88  
89          intValueSet = true;
90      }
91  
92      public void setFloatValue(float floatValue) {
93          this.floatValueVariable = floatValue;
94  
95          floatValueSet = true;
96      }
97  
98      public void setLongValue(long longValue) {
99          this.longValueVariable = longValue;
100 
101         longValueSet = true;
102     }
103 
104     public void setDoubleValue(double doubleValue) {
105         this.doubleValueVariable = doubleValue;
106 
107         doubleValueSet = true;
108     }
109 
110     public void setStringValue(String stringValue) {
111         this.stringValueVariable = stringValue;
112 
113         stringValueSet = true;
114     }
115 
116     public void setImportantThings(List importantThings) {
117         this.importantThingsVariable = importantThings;
118 
119         importantThingsValueSet = true;
120     }
121 
122     public void setConfiguration(PlexusConfiguration configuration) {
123         this.configurationVariable = configuration;
124 
125         configurationValueSet = true;
126     }
127 }