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