Rename conf to policy and make parentID optional (via null)
[aquarium] / src / main / java / gr / grnet / aquarium / message / avro / gen / _AnyValue.java
1 /**
2  * Autogenerated by Avro
3  * 
4  * DO NOT EDIT DIRECTLY
5  */
6 package gr.grnet.aquarium.message.avro.gen;  
7 @SuppressWarnings("all")
8 public class _AnyValue extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord {
9   public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"_AnyValue\",\"namespace\":\"gr.grnet.aquarium.message.avro.gen\",\"fields\":[{\"name\":\"anyValue\",\"type\":[\"null\",\"int\",\"long\",\"boolean\",\"double\",\"bytes\",\"string\"]}]}");
10   @Deprecated public java.lang.Object anyValue;
11   public org.apache.avro.Schema getSchema() { return SCHEMA$; }
12   // Used by DatumWriter.  Applications should not call. 
13   public java.lang.Object get(int field$) {
14     switch (field$) {
15     case 0: return anyValue;
16     default: throw new org.apache.avro.AvroRuntimeException("Bad index");
17     }
18   }
19   // Used by DatumReader.  Applications should not call. 
20   @SuppressWarnings(value="unchecked")
21   public void put(int field$, java.lang.Object value$) {
22     switch (field$) {
23     case 0: anyValue = (java.lang.Object)value$; break;
24     default: throw new org.apache.avro.AvroRuntimeException("Bad index");
25     }
26   }
27
28   /**
29    * Gets the value of the 'anyValue' field.
30    */
31   public java.lang.Object getAnyValue() {
32     return anyValue;
33   }
34
35   /**
36    * Sets the value of the 'anyValue' field.
37    * @param value the value to set.
38    */
39   public void setAnyValue(java.lang.Object value) {
40     this.anyValue = value;
41   }
42
43   /** Creates a new _AnyValue RecordBuilder */
44   public static gr.grnet.aquarium.message.avro.gen._AnyValue.Builder newBuilder() {
45     return new gr.grnet.aquarium.message.avro.gen._AnyValue.Builder();
46   }
47   
48   /** Creates a new _AnyValue RecordBuilder by copying an existing Builder */
49   public static gr.grnet.aquarium.message.avro.gen._AnyValue.Builder newBuilder(gr.grnet.aquarium.message.avro.gen._AnyValue.Builder other) {
50     return new gr.grnet.aquarium.message.avro.gen._AnyValue.Builder(other);
51   }
52   
53   /** Creates a new _AnyValue RecordBuilder by copying an existing _AnyValue instance */
54   public static gr.grnet.aquarium.message.avro.gen._AnyValue.Builder newBuilder(gr.grnet.aquarium.message.avro.gen._AnyValue other) {
55     return new gr.grnet.aquarium.message.avro.gen._AnyValue.Builder(other);
56   }
57   
58   /**
59    * RecordBuilder for _AnyValue instances.
60    */
61   public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<_AnyValue>
62     implements org.apache.avro.data.RecordBuilder<_AnyValue> {
63
64     private java.lang.Object anyValue;
65
66     /** Creates a new Builder */
67     private Builder() {
68       super(gr.grnet.aquarium.message.avro.gen._AnyValue.SCHEMA$);
69     }
70     
71     /** Creates a Builder by copying an existing Builder */
72     private Builder(gr.grnet.aquarium.message.avro.gen._AnyValue.Builder other) {
73       super(other);
74     }
75     
76     /** Creates a Builder by copying an existing _AnyValue instance */
77     private Builder(gr.grnet.aquarium.message.avro.gen._AnyValue other) {
78             super(gr.grnet.aquarium.message.avro.gen._AnyValue.SCHEMA$);
79       if (isValidValue(fields()[0], other.anyValue)) {
80         this.anyValue = (java.lang.Object) data().deepCopy(fields()[0].schema(), other.anyValue);
81         fieldSetFlags()[0] = true;
82       }
83     }
84
85     /** Gets the value of the 'anyValue' field */
86     public java.lang.Object getAnyValue() {
87       return anyValue;
88     }
89     
90     /** Sets the value of the 'anyValue' field */
91     public gr.grnet.aquarium.message.avro.gen._AnyValue.Builder setAnyValue(java.lang.Object value) {
92       validate(fields()[0], value);
93       this.anyValue = value;
94       fieldSetFlags()[0] = true;
95       return this; 
96     }
97     
98     /** Checks whether the 'anyValue' field has been set */
99     public boolean hasAnyValue() {
100       return fieldSetFlags()[0];
101     }
102     
103     /** Clears the value of the 'anyValue' field */
104     public gr.grnet.aquarium.message.avro.gen._AnyValue.Builder clearAnyValue() {
105       anyValue = null;
106       fieldSetFlags()[0] = false;
107       return this;
108     }
109
110     @Override
111     public _AnyValue build() {
112       try {
113         _AnyValue record = new _AnyValue();
114         record.anyValue = fieldSetFlags()[0] ? this.anyValue : (java.lang.Object) defaultValue(fields()[0]);
115         return record;
116       } catch (Exception e) {
117         throw new org.apache.avro.AvroRuntimeException(e);
118       }
119     }
120   }
121 }