001// =================== DO NOT EDIT THIS FILE ==================== 002// Generated by Modello 1.8.3, 003// any modifications will be overwritten. 004// ============================================================== 005 006package org.apache.maven.toolchain.model; 007 008/** 009 * Definition of a toolchain instance. 010 * 011 * @version $Revision: 965443 $ $Date: 2015-09-14 22:18:52 +0000 (Mon, 14 Sep 2015) $ 012 */ 013@SuppressWarnings( "all" ) 014public class ToolchainModel 015 extends TrackableBase 016 implements java.io.Serializable, java.lang.Cloneable 017{ 018 019 //--------------------------/ 020 //- Class/Member Variables -/ 021 //--------------------------/ 022 023 /** 024 * 025 * Type of toolchain:<ul> 026 * <li><code>jdk</code> for 027 * <a 028 * href="http://maven.apache.org/plugins/maven-toolchains-plugin/toolchains/jdk.html">JDK 029 * Standard Toolchain</a>,</li> 030 * <li>other value for 031 * <a 032 * href="http://maven.apache.org/plugins/maven-toolchains-plugin/toolchains/custom.html">Custom 033 * Toolchain</a></li> 034 * </ul> 035 * 036 */ 037 private String type; 038 039 /** 040 * Field provides. 041 */ 042 private java.util.Properties provides; 043 044 /** 045 * 046 * 047 * <p>Toolchain configuration information, 048 * like location or any information that is to be 049 * retrieved.</p> 050 * <p>Actual content structure is 051 * completely open: each toochain type will define its own 052 * format and semantics.</p> 053 * <p>In general, this is a properties 054 * format: <code><name>value</name></code> with 055 * per-toolchain defined properties 056 * names.</p> 057 * 058 */ 059 private Object configuration; 060 061 062 //-----------/ 063 //- Methods -/ 064 //-----------/ 065 066 /** 067 * Method addProvide. 068 * 069 * @param key 070 * @param value 071 */ 072 public void addProvide( String key, String value ) 073 { 074 getProvides().put( key, value ); 075 } //-- void addProvide( String, String ) 076 077 /** 078 * Method clone. 079 * 080 * @return ToolchainModel 081 */ 082 public ToolchainModel clone() 083 { 084 try 085 { 086 ToolchainModel copy = (ToolchainModel) super.clone(); 087 088 if ( this.provides != null ) 089 { 090 copy.provides = (java.util.Properties) this.provides.clone(); 091 } 092 093 if ( this.configuration != null ) 094 { 095 copy.configuration = new org.codehaus.plexus.util.xml.Xpp3Dom( (org.codehaus.plexus.util.xml.Xpp3Dom) this.configuration ); 096 } 097 098 return copy; 099 } 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><name>value</name></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><name>value</name></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}