001/** 002 * Autogenerated by Avro 003 * 004 * DO NOT EDIT DIRECTLY 005 */ 006package org.apache.reef.tang.implementation.avro; 007@SuppressWarnings("all") 008@org.apache.avro.specific.AvroGenerated 009public class AvroNode extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord { 010 public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"AvroNode\",\"namespace\":\"org.apache.reef.tang.implementation.avro\",\"fields\":[{\"name\":\"name\",\"type\":\"string\"},{\"name\":\"fullName\",\"type\":\"string\"},{\"name\":\"classNode\",\"type\":[\"null\",{\"type\":\"record\",\"name\":\"AvroClassNode\",\"fields\":[{\"name\":\"isInjectionCandidate\",\"type\":\"boolean\"},{\"name\":\"isExternalConstructor\",\"type\":\"boolean\"},{\"name\":\"isUnit\",\"type\":\"boolean\"},{\"name\":\"injectableConstructors\",\"type\":{\"type\":\"array\",\"items\":{\"type\":\"record\",\"name\":\"AvroConstructorDef\",\"fields\":[{\"name\":\"fullClassName\",\"type\":\"string\"},{\"name\":\"constructorArgs\",\"type\":{\"type\":\"array\",\"items\":{\"type\":\"record\",\"name\":\"AvroConstructorArg\",\"fields\":[{\"name\":\"fullArgClassName\",\"type\":\"string\"},{\"name\":\"namedParameterName\",\"type\":[\"null\",\"string\"],\"default\":null},{\"name\":\"isInjectionFuture\",\"type\":\"boolean\"}]}}}]}}},{\"name\":\"otherConstructors\",\"type\":{\"type\":\"array\",\"items\":\"AvroConstructorDef\"}},{\"name\":\"implFullNames\",\"type\":{\"type\":\"array\",\"items\":\"string\"}},{\"name\":\"defaultImplementation\",\"type\":[\"null\",\"string\"],\"default\":null}]}],\"default\":null},{\"name\":\"namedParameterNode\",\"type\":[\"null\",{\"type\":\"record\",\"name\":\"AvroNamedParameterNode\",\"fields\":[{\"name\":\"simpleArgClassName\",\"type\":\"string\"},{\"name\":\"fullArgClassName\",\"type\":\"string\"},{\"name\":\"isSet\",\"type\":\"boolean\"},{\"name\":\"isList\",\"type\":\"boolean\"},{\"name\":\"documentation\",\"type\":[\"null\",\"string\"],\"default\":null},{\"name\":\"shortName\",\"type\":[\"null\",\"string\"],\"default\":null},{\"name\":\"instanceDefault\",\"type\":{\"type\":\"array\",\"items\":\"string\"}}]}],\"default\":null},{\"name\":\"packageNode\",\"type\":[\"null\",{\"type\":\"record\",\"name\":\"AvroPackageNode\",\"fields\":[]}],\"default\":null},{\"name\":\"children\",\"type\":{\"type\":\"array\",\"items\":\"AvroNode\"}}]}"); 011 public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; } 012 @Deprecated public java.lang.CharSequence name; 013 @Deprecated public java.lang.CharSequence fullName; 014 @Deprecated public org.apache.reef.tang.implementation.avro.AvroClassNode classNode; 015 @Deprecated public org.apache.reef.tang.implementation.avro.AvroNamedParameterNode namedParameterNode; 016 @Deprecated public org.apache.reef.tang.implementation.avro.AvroPackageNode packageNode; 017 @Deprecated public java.util.List<org.apache.reef.tang.implementation.avro.AvroNode> children; 018 019 /** 020 * Default constructor. Note that this does not initialize fields 021 * to their default values from the schema. If that is desired then 022 * one should use <code>newBuilder()</code>. 023 */ 024 public AvroNode() {} 025 026 /** 027 * All-args constructor. 028 */ 029 public AvroNode(java.lang.CharSequence name, java.lang.CharSequence fullName, org.apache.reef.tang.implementation.avro.AvroClassNode classNode, org.apache.reef.tang.implementation.avro.AvroNamedParameterNode namedParameterNode, org.apache.reef.tang.implementation.avro.AvroPackageNode packageNode, java.util.List<org.apache.reef.tang.implementation.avro.AvroNode> children) { 030 this.name = name; 031 this.fullName = fullName; 032 this.classNode = classNode; 033 this.namedParameterNode = namedParameterNode; 034 this.packageNode = packageNode; 035 this.children = children; 036 } 037 038 public org.apache.avro.Schema getSchema() { return SCHEMA$; } 039 // Used by DatumWriter. Applications should not call. 040 public java.lang.Object get(int field$) { 041 switch (field$) { 042 case 0: return name; 043 case 1: return fullName; 044 case 2: return classNode; 045 case 3: return namedParameterNode; 046 case 4: return packageNode; 047 case 5: return children; 048 default: throw new org.apache.avro.AvroRuntimeException("Bad index"); 049 } 050 } 051 // Used by DatumReader. Applications should not call. 052 @SuppressWarnings(value="unchecked") 053 public void put(int field$, java.lang.Object value$) { 054 switch (field$) { 055 case 0: name = (java.lang.CharSequence)value$; break; 056 case 1: fullName = (java.lang.CharSequence)value$; break; 057 case 2: classNode = (org.apache.reef.tang.implementation.avro.AvroClassNode)value$; break; 058 case 3: namedParameterNode = (org.apache.reef.tang.implementation.avro.AvroNamedParameterNode)value$; break; 059 case 4: packageNode = (org.apache.reef.tang.implementation.avro.AvroPackageNode)value$; break; 060 case 5: children = (java.util.List<org.apache.reef.tang.implementation.avro.AvroNode>)value$; break; 061 default: throw new org.apache.avro.AvroRuntimeException("Bad index"); 062 } 063 } 064 065 /** 066 * Gets the value of the 'name' field. 067 */ 068 public java.lang.CharSequence getName() { 069 return name; 070 } 071 072 /** 073 * Sets the value of the 'name' field. 074 * @param value the value to set. 075 */ 076 public void setName(java.lang.CharSequence value) { 077 this.name = value; 078 } 079 080 /** 081 * Gets the value of the 'fullName' field. 082 */ 083 public java.lang.CharSequence getFullName() { 084 return fullName; 085 } 086 087 /** 088 * Sets the value of the 'fullName' field. 089 * @param value the value to set. 090 */ 091 public void setFullName(java.lang.CharSequence value) { 092 this.fullName = value; 093 } 094 095 /** 096 * Gets the value of the 'classNode' field. 097 */ 098 public org.apache.reef.tang.implementation.avro.AvroClassNode getClassNode() { 099 return classNode; 100 } 101 102 /** 103 * Sets the value of the 'classNode' field. 104 * @param value the value to set. 105 */ 106 public void setClassNode(org.apache.reef.tang.implementation.avro.AvroClassNode value) { 107 this.classNode = value; 108 } 109 110 /** 111 * Gets the value of the 'namedParameterNode' field. 112 */ 113 public org.apache.reef.tang.implementation.avro.AvroNamedParameterNode getNamedParameterNode() { 114 return namedParameterNode; 115 } 116 117 /** 118 * Sets the value of the 'namedParameterNode' field. 119 * @param value the value to set. 120 */ 121 public void setNamedParameterNode(org.apache.reef.tang.implementation.avro.AvroNamedParameterNode value) { 122 this.namedParameterNode = value; 123 } 124 125 /** 126 * Gets the value of the 'packageNode' field. 127 */ 128 public org.apache.reef.tang.implementation.avro.AvroPackageNode getPackageNode() { 129 return packageNode; 130 } 131 132 /** 133 * Sets the value of the 'packageNode' field. 134 * @param value the value to set. 135 */ 136 public void setPackageNode(org.apache.reef.tang.implementation.avro.AvroPackageNode value) { 137 this.packageNode = value; 138 } 139 140 /** 141 * Gets the value of the 'children' field. 142 */ 143 public java.util.List<org.apache.reef.tang.implementation.avro.AvroNode> getChildren() { 144 return children; 145 } 146 147 /** 148 * Sets the value of the 'children' field. 149 * @param value the value to set. 150 */ 151 public void setChildren(java.util.List<org.apache.reef.tang.implementation.avro.AvroNode> value) { 152 this.children = value; 153 } 154 155 /** Creates a new AvroNode RecordBuilder */ 156 public static org.apache.reef.tang.implementation.avro.AvroNode.Builder newBuilder() { 157 return new org.apache.reef.tang.implementation.avro.AvroNode.Builder(); 158 } 159 160 /** Creates a new AvroNode RecordBuilder by copying an existing Builder */ 161 public static org.apache.reef.tang.implementation.avro.AvroNode.Builder newBuilder(org.apache.reef.tang.implementation.avro.AvroNode.Builder other) { 162 return new org.apache.reef.tang.implementation.avro.AvroNode.Builder(other); 163 } 164 165 /** Creates a new AvroNode RecordBuilder by copying an existing AvroNode instance */ 166 public static org.apache.reef.tang.implementation.avro.AvroNode.Builder newBuilder(org.apache.reef.tang.implementation.avro.AvroNode other) { 167 return new org.apache.reef.tang.implementation.avro.AvroNode.Builder(other); 168 } 169 170 /** 171 * RecordBuilder for AvroNode instances. 172 */ 173 public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<AvroNode> 174 implements org.apache.avro.data.RecordBuilder<AvroNode> { 175 176 private java.lang.CharSequence name; 177 private java.lang.CharSequence fullName; 178 private org.apache.reef.tang.implementation.avro.AvroClassNode classNode; 179 private org.apache.reef.tang.implementation.avro.AvroNamedParameterNode namedParameterNode; 180 private org.apache.reef.tang.implementation.avro.AvroPackageNode packageNode; 181 private java.util.List<org.apache.reef.tang.implementation.avro.AvroNode> children; 182 183 /** Creates a new Builder */ 184 private Builder() { 185 super(org.apache.reef.tang.implementation.avro.AvroNode.SCHEMA$); 186 } 187 188 /** Creates a Builder by copying an existing Builder */ 189 private Builder(org.apache.reef.tang.implementation.avro.AvroNode.Builder other) { 190 super(other); 191 if (isValidValue(fields()[0], other.name)) { 192 this.name = data().deepCopy(fields()[0].schema(), other.name); 193 fieldSetFlags()[0] = true; 194 } 195 if (isValidValue(fields()[1], other.fullName)) { 196 this.fullName = data().deepCopy(fields()[1].schema(), other.fullName); 197 fieldSetFlags()[1] = true; 198 } 199 if (isValidValue(fields()[2], other.classNode)) { 200 this.classNode = data().deepCopy(fields()[2].schema(), other.classNode); 201 fieldSetFlags()[2] = true; 202 } 203 if (isValidValue(fields()[3], other.namedParameterNode)) { 204 this.namedParameterNode = data().deepCopy(fields()[3].schema(), other.namedParameterNode); 205 fieldSetFlags()[3] = true; 206 } 207 if (isValidValue(fields()[4], other.packageNode)) { 208 this.packageNode = data().deepCopy(fields()[4].schema(), other.packageNode); 209 fieldSetFlags()[4] = true; 210 } 211 if (isValidValue(fields()[5], other.children)) { 212 this.children = data().deepCopy(fields()[5].schema(), other.children); 213 fieldSetFlags()[5] = true; 214 } 215 } 216 217 /** Creates a Builder by copying an existing AvroNode instance */ 218 private Builder(org.apache.reef.tang.implementation.avro.AvroNode other) { 219 super(org.apache.reef.tang.implementation.avro.AvroNode.SCHEMA$); 220 if (isValidValue(fields()[0], other.name)) { 221 this.name = data().deepCopy(fields()[0].schema(), other.name); 222 fieldSetFlags()[0] = true; 223 } 224 if (isValidValue(fields()[1], other.fullName)) { 225 this.fullName = data().deepCopy(fields()[1].schema(), other.fullName); 226 fieldSetFlags()[1] = true; 227 } 228 if (isValidValue(fields()[2], other.classNode)) { 229 this.classNode = data().deepCopy(fields()[2].schema(), other.classNode); 230 fieldSetFlags()[2] = true; 231 } 232 if (isValidValue(fields()[3], other.namedParameterNode)) { 233 this.namedParameterNode = data().deepCopy(fields()[3].schema(), other.namedParameterNode); 234 fieldSetFlags()[3] = true; 235 } 236 if (isValidValue(fields()[4], other.packageNode)) { 237 this.packageNode = data().deepCopy(fields()[4].schema(), other.packageNode); 238 fieldSetFlags()[4] = true; 239 } 240 if (isValidValue(fields()[5], other.children)) { 241 this.children = data().deepCopy(fields()[5].schema(), other.children); 242 fieldSetFlags()[5] = true; 243 } 244 } 245 246 /** Gets the value of the 'name' field */ 247 public java.lang.CharSequence getName() { 248 return name; 249 } 250 251 /** Sets the value of the 'name' field */ 252 public org.apache.reef.tang.implementation.avro.AvroNode.Builder setName(java.lang.CharSequence value) { 253 validate(fields()[0], value); 254 this.name = value; 255 fieldSetFlags()[0] = true; 256 return this; 257 } 258 259 /** Checks whether the 'name' field has been set */ 260 public boolean hasName() { 261 return fieldSetFlags()[0]; 262 } 263 264 /** Clears the value of the 'name' field */ 265 public org.apache.reef.tang.implementation.avro.AvroNode.Builder clearName() { 266 name = null; 267 fieldSetFlags()[0] = false; 268 return this; 269 } 270 271 /** Gets the value of the 'fullName' field */ 272 public java.lang.CharSequence getFullName() { 273 return fullName; 274 } 275 276 /** Sets the value of the 'fullName' field */ 277 public org.apache.reef.tang.implementation.avro.AvroNode.Builder setFullName(java.lang.CharSequence value) { 278 validate(fields()[1], value); 279 this.fullName = value; 280 fieldSetFlags()[1] = true; 281 return this; 282 } 283 284 /** Checks whether the 'fullName' field has been set */ 285 public boolean hasFullName() { 286 return fieldSetFlags()[1]; 287 } 288 289 /** Clears the value of the 'fullName' field */ 290 public org.apache.reef.tang.implementation.avro.AvroNode.Builder clearFullName() { 291 fullName = null; 292 fieldSetFlags()[1] = false; 293 return this; 294 } 295 296 /** Gets the value of the 'classNode' field */ 297 public org.apache.reef.tang.implementation.avro.AvroClassNode getClassNode() { 298 return classNode; 299 } 300 301 /** Sets the value of the 'classNode' field */ 302 public org.apache.reef.tang.implementation.avro.AvroNode.Builder setClassNode(org.apache.reef.tang.implementation.avro.AvroClassNode value) { 303 validate(fields()[2], value); 304 this.classNode = value; 305 fieldSetFlags()[2] = true; 306 return this; 307 } 308 309 /** Checks whether the 'classNode' field has been set */ 310 public boolean hasClassNode() { 311 return fieldSetFlags()[2]; 312 } 313 314 /** Clears the value of the 'classNode' field */ 315 public org.apache.reef.tang.implementation.avro.AvroNode.Builder clearClassNode() { 316 classNode = null; 317 fieldSetFlags()[2] = false; 318 return this; 319 } 320 321 /** Gets the value of the 'namedParameterNode' field */ 322 public org.apache.reef.tang.implementation.avro.AvroNamedParameterNode getNamedParameterNode() { 323 return namedParameterNode; 324 } 325 326 /** Sets the value of the 'namedParameterNode' field */ 327 public org.apache.reef.tang.implementation.avro.AvroNode.Builder setNamedParameterNode(org.apache.reef.tang.implementation.avro.AvroNamedParameterNode value) { 328 validate(fields()[3], value); 329 this.namedParameterNode = value; 330 fieldSetFlags()[3] = true; 331 return this; 332 } 333 334 /** Checks whether the 'namedParameterNode' field has been set */ 335 public boolean hasNamedParameterNode() { 336 return fieldSetFlags()[3]; 337 } 338 339 /** Clears the value of the 'namedParameterNode' field */ 340 public org.apache.reef.tang.implementation.avro.AvroNode.Builder clearNamedParameterNode() { 341 namedParameterNode = null; 342 fieldSetFlags()[3] = false; 343 return this; 344 } 345 346 /** Gets the value of the 'packageNode' field */ 347 public org.apache.reef.tang.implementation.avro.AvroPackageNode getPackageNode() { 348 return packageNode; 349 } 350 351 /** Sets the value of the 'packageNode' field */ 352 public org.apache.reef.tang.implementation.avro.AvroNode.Builder setPackageNode(org.apache.reef.tang.implementation.avro.AvroPackageNode value) { 353 validate(fields()[4], value); 354 this.packageNode = value; 355 fieldSetFlags()[4] = true; 356 return this; 357 } 358 359 /** Checks whether the 'packageNode' field has been set */ 360 public boolean hasPackageNode() { 361 return fieldSetFlags()[4]; 362 } 363 364 /** Clears the value of the 'packageNode' field */ 365 public org.apache.reef.tang.implementation.avro.AvroNode.Builder clearPackageNode() { 366 packageNode = null; 367 fieldSetFlags()[4] = false; 368 return this; 369 } 370 371 /** Gets the value of the 'children' field */ 372 public java.util.List<org.apache.reef.tang.implementation.avro.AvroNode> getChildren() { 373 return children; 374 } 375 376 /** Sets the value of the 'children' field */ 377 public org.apache.reef.tang.implementation.avro.AvroNode.Builder setChildren(java.util.List<org.apache.reef.tang.implementation.avro.AvroNode> value) { 378 validate(fields()[5], value); 379 this.children = value; 380 fieldSetFlags()[5] = true; 381 return this; 382 } 383 384 /** Checks whether the 'children' field has been set */ 385 public boolean hasChildren() { 386 return fieldSetFlags()[5]; 387 } 388 389 /** Clears the value of the 'children' field */ 390 public org.apache.reef.tang.implementation.avro.AvroNode.Builder clearChildren() { 391 children = null; 392 fieldSetFlags()[5] = false; 393 return this; 394 } 395 396 @Override 397 public AvroNode build() { 398 try { 399 AvroNode record = new AvroNode(); 400 record.name = fieldSetFlags()[0] ? this.name : (java.lang.CharSequence) defaultValue(fields()[0]); 401 record.fullName = fieldSetFlags()[1] ? this.fullName : (java.lang.CharSequence) defaultValue(fields()[1]); 402 record.classNode = fieldSetFlags()[2] ? this.classNode : (org.apache.reef.tang.implementation.avro.AvroClassNode) defaultValue(fields()[2]); 403 record.namedParameterNode = fieldSetFlags()[3] ? this.namedParameterNode : (org.apache.reef.tang.implementation.avro.AvroNamedParameterNode) defaultValue(fields()[3]); 404 record.packageNode = fieldSetFlags()[4] ? this.packageNode : (org.apache.reef.tang.implementation.avro.AvroPackageNode) defaultValue(fields()[4]); 405 record.children = fieldSetFlags()[5] ? this.children : (java.util.List<org.apache.reef.tang.implementation.avro.AvroNode>) defaultValue(fields()[5]); 406 return record; 407 } catch (Exception e) { 408 throw new org.apache.avro.AvroRuntimeException(e); 409 } 410 } 411 } 412}