View Javadoc
1   // =================== DO NOT EDIT THIS FILE ====================
2   // Generated by Modello 1.8.3,
3   // any modifications will be overwritten.
4   // ==============================================================
5   
6   package org.apache.maven.toolchain.model;
7   
8   /**
9    * Definition of a toolchain instance.
10   * 
11   * @version $Revision: 965443 $ $Date: 2015-09-14 15:18:52 -0700 (Mon, 14 Sep 2015) $
12   */
13  @SuppressWarnings( "all" )
14  public class ToolchainModel
15      extends TrackableBase
16      implements java.io.Serializable, java.lang.Cloneable
17  {
18  
19        //--------------------------/
20       //- Class/Member Variables -/
21      //--------------------------/
22  
23      /**
24       * 
25       *                     Type of toolchain:<ul>
26       *                     <li><code>jdk</code> for
27       *                     <a
28       * href="http://maven.apache.org/plugins/maven-toolchains-plugin/toolchains/jdk.html">JDK
29       * Standard Toolchain</a>,</li>
30       *                     <li>other value for
31       *                     <a
32       * href="http://maven.apache.org/plugins/maven-toolchains-plugin/toolchains/custom.html">Custom
33       * Toolchain</a></li>
34       *                     </ul>
35       *                     
36       */
37      private String type;
38  
39      /**
40       * Field provides.
41       */
42      private java.util.Properties provides;
43  
44      /**
45       * 
46       *                     
47       *                     <p>Toolchain configuration information,
48       * like location or any information that is to be
49       * retrieved.</p>
50       *                     <p>Actual content structure is
51       * completely open: each toochain type will define its own
52       * format and semantics.</p>
53       *                     <p>In general, this is a properties
54       * format: <code>&lt;name&gt;value&lt;/name&gt;</code> with
55       *                     per-toolchain defined properties
56       * names.</p>
57       *                     
58       */
59      private Object configuration;
60  
61  
62        //-----------/
63       //- Methods -/
64      //-----------/
65  
66      /**
67       * Method addProvide.
68       * 
69       * @param key
70       * @param value
71       */
72      public void addProvide( String key, String value )
73      {
74          getProvides().put( key, value );
75      } //-- void addProvide( String, String )
76  
77      /**
78       * Method clone.
79       * 
80       * @return ToolchainModel
81       */
82      public ToolchainModel clone()
83      {
84          try
85          {
86              ToolchainModel copy = (ToolchainModel) super.clone();
87  
88              if ( this.provides != null )
89              {
90                  copy.provides = (java.util.Properties) this.provides.clone();
91              }
92  
93              if ( this.configuration != null )
94              {
95                  copy.configuration = new org.codehaus.plexus.util.xml.Xpp3Dom( (org.codehaus.plexus.util.xml.Xpp3Dom) this.configuration );
96              }
97  
98              return copy;
99          }
100         catch ( java.lang.Exception ex )
101         {
102             throw (java.lang.RuntimeException) new java.lang.UnsupportedOperationException( getClass().getName()
103                 + " does not support clone()" ).initCause( ex );
104         }
105     } //-- ToolchainModel clone()
106 
107     /**
108      * Get <p>Toolchain configuration information, like location or
109      * any information that is to be retrieved.</p>
110      *                     <p>Actual content structure is
111      * completely open: each toochain type will define its own
112      * format and semantics.</p>
113      *                     <p>In general, this is a properties
114      * format: <code>&lt;name&gt;value&lt;/name&gt;</code> with
115      *                     per-toolchain defined properties
116      * names.</p>
117      * 
118      * @return Object
119      */
120     public Object getConfiguration()
121     {
122         return this.configuration;
123     } //-- Object getConfiguration()
124 
125     /**
126      * Method getProvides.
127      * 
128      * @return Properties
129      */
130     public java.util.Properties getProvides()
131     {
132         if ( this.provides == null )
133         {
134             this.provides = new java.util.Properties();
135         }
136 
137         return this.provides;
138     } //-- java.util.Properties getProvides()
139 
140     /**
141      * Get type of toolchain:<ul>
142      *                     <li><code>jdk</code> for
143      *                     <a
144      * href="http://maven.apache.org/plugins/maven-toolchains-plugin/toolchains/jdk.html">JDK
145      * Standard Toolchain</a>,</li>
146      *                     <li>other value for
147      *                     <a
148      * href="http://maven.apache.org/plugins/maven-toolchains-plugin/toolchains/custom.html">Custom
149      * Toolchain</a></li>
150      *                     </ul>
151      * 
152      * @return String
153      */
154     public String getType()
155     {
156         return this.type;
157     } //-- String getType()
158 
159     /**
160      * Set <p>Toolchain configuration information, like location or
161      * any information that is to be retrieved.</p>
162      *                     <p>Actual content structure is
163      * completely open: each toochain type will define its own
164      * format and semantics.</p>
165      *                     <p>In general, this is a properties
166      * format: <code>&lt;name&gt;value&lt;/name&gt;</code> with
167      *                     per-toolchain defined properties
168      * names.</p>
169      * 
170      * @param configuration
171      */
172     public void setConfiguration( Object configuration )
173     {
174         this.configuration = configuration;
175     } //-- void setConfiguration( Object )
176 
177     /**
178      * Set <p>Toolchain identification information, which will be
179      * matched against project requirements.</p>
180      *                     <p>For Maven 2.0.9 to 3.2.3, the actual
181      * content structure was completely open: each toolchain type
182      * would define its own format and semantics.
183      *                     In general, this was a properties
184      * format.</p>
185      *                     <p>Since Maven 3.2.4, the type for this
186      * field has been changed to Properties to match the de-facto
187      * format.</p>
188      *                     <p>Each toolchain defines its own
189      * properties names and semantics.</p>
190      * 
191      * @param provides
192      */
193     public void setProvides( java.util.Properties provides )
194     {
195         this.provides = provides;
196     } //-- void setProvides( java.util.Properties )
197 
198     /**
199      * Set type of toolchain:<ul>
200      *                     <li><code>jdk</code> for
201      *                     <a
202      * href="http://maven.apache.org/plugins/maven-toolchains-plugin/toolchains/jdk.html">JDK
203      * Standard Toolchain</a>,</li>
204      *                     <li>other value for
205      *                     <a
206      * href="http://maven.apache.org/plugins/maven-toolchains-plugin/toolchains/custom.html">Custom
207      * Toolchain</a></li>
208      *                     </ul>
209      * 
210      * @param type
211      */
212     public void setType( String type )
213     {
214         this.type = type;
215     } //-- void setType( String )
216 
217     
218                 
219     /**
220      * Method hashCode.
221      * 
222      * @return int
223      */
224     public int hashCode()
225     {
226         int result = 17;
227 
228         result = 37 * result + ( type != null ? type.hashCode() : 0 );
229         result = 37 * result + ( provides != null ? provides.hashCode() : 0 );
230 
231         return result;
232     } //-- int hashCode()
233     
234     /**
235      * Method equals.
236      * 
237      * @param other
238      * @return boolean
239      */
240     public boolean equals( Object other )
241     {
242         if ( this == other )
243         {
244             return true;
245         }
246 
247         if ( !( other instanceof ToolchainModel ) )
248         {
249             return false;
250         }
251 
252         ToolchainModel that = (ToolchainModel) other;
253         boolean result = true;
254 
255         result = result && ( getType() == null ? that.getType() == null : getType().equals( that.getType() ) );
256         result = result && ( getProvides() == null ? that.getProvides() == null : getProvides().equals( that.getProvides() ) );
257 
258         return result;
259     } //-- boolean equals( Object )    
260                 
261               
262 }