Rename all messages
[aquarium] / src / main / java / gr / grnet / aquarium / message / avro / gen / ResourceTypeMsg.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 ResourceTypeMsg 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\":\"ResourceTypeMsg\",\"namespace\":\"gr.grnet.aquarium.message.avro.gen\",\"fields\":[{\"name\":\"name\",\"type\":\"string\"},{\"name\":\"unit\",\"type\":\"string\"},{\"name\":\"chargingBehaviorClass\",\"type\":\"string\"}]}");
10   @Deprecated public java.lang.CharSequence name;
11   @Deprecated public java.lang.CharSequence unit;
12   @Deprecated public java.lang.CharSequence chargingBehaviorClass;
13   public org.apache.avro.Schema getSchema() { return SCHEMA$; }
14   // Used by DatumWriter.  Applications should not call. 
15   public java.lang.Object get(int field$) {
16     switch (field$) {
17     case 0: return name;
18     case 1: return unit;
19     case 2: return chargingBehaviorClass;
20     default: throw new org.apache.avro.AvroRuntimeException("Bad index");
21     }
22   }
23   // Used by DatumReader.  Applications should not call. 
24   @SuppressWarnings(value="unchecked")
25   public void put(int field$, java.lang.Object value$) {
26     switch (field$) {
27     case 0: name = (java.lang.CharSequence)value$; break;
28     case 1: unit = (java.lang.CharSequence)value$; break;
29     case 2: chargingBehaviorClass = (java.lang.CharSequence)value$; break;
30     default: throw new org.apache.avro.AvroRuntimeException("Bad index");
31     }
32   }
33
34   /**
35    * Gets the value of the 'name' field.
36    */
37   public java.lang.CharSequence getName() {
38     return name;
39   }
40
41   /**
42    * Sets the value of the 'name' field.
43    * @param value the value to set.
44    */
45   public void setName(java.lang.CharSequence value) {
46     this.name = value;
47   }
48
49   /**
50    * Gets the value of the 'unit' field.
51    */
52   public java.lang.CharSequence getUnit() {
53     return unit;
54   }
55
56   /**
57    * Sets the value of the 'unit' field.
58    * @param value the value to set.
59    */
60   public void setUnit(java.lang.CharSequence value) {
61     this.unit = value;
62   }
63
64   /**
65    * Gets the value of the 'chargingBehaviorClass' field.
66    */
67   public java.lang.CharSequence getChargingBehaviorClass() {
68     return chargingBehaviorClass;
69   }
70
71   /**
72    * Sets the value of the 'chargingBehaviorClass' field.
73    * @param value the value to set.
74    */
75   public void setChargingBehaviorClass(java.lang.CharSequence value) {
76     this.chargingBehaviorClass = value;
77   }
78
79   /** Creates a new ResourceTypeMsg RecordBuilder */
80   public static gr.grnet.aquarium.message.avro.gen.ResourceTypeMsg.Builder newBuilder() {
81     return new gr.grnet.aquarium.message.avro.gen.ResourceTypeMsg.Builder();
82   }
83   
84   /** Creates a new ResourceTypeMsg RecordBuilder by copying an existing Builder */
85   public static gr.grnet.aquarium.message.avro.gen.ResourceTypeMsg.Builder newBuilder(gr.grnet.aquarium.message.avro.gen.ResourceTypeMsg.Builder other) {
86     return new gr.grnet.aquarium.message.avro.gen.ResourceTypeMsg.Builder(other);
87   }
88   
89   /** Creates a new ResourceTypeMsg RecordBuilder by copying an existing ResourceTypeMsg instance */
90   public static gr.grnet.aquarium.message.avro.gen.ResourceTypeMsg.Builder newBuilder(gr.grnet.aquarium.message.avro.gen.ResourceTypeMsg other) {
91     return new gr.grnet.aquarium.message.avro.gen.ResourceTypeMsg.Builder(other);
92   }
93   
94   /**
95    * RecordBuilder for ResourceTypeMsg instances.
96    */
97   public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<ResourceTypeMsg>
98     implements org.apache.avro.data.RecordBuilder<ResourceTypeMsg> {
99
100     private java.lang.CharSequence name;
101     private java.lang.CharSequence unit;
102     private java.lang.CharSequence chargingBehaviorClass;
103
104     /** Creates a new Builder */
105     private Builder() {
106       super(gr.grnet.aquarium.message.avro.gen.ResourceTypeMsg.SCHEMA$);
107     }
108     
109     /** Creates a Builder by copying an existing Builder */
110     private Builder(gr.grnet.aquarium.message.avro.gen.ResourceTypeMsg.Builder other) {
111       super(other);
112     }
113     
114     /** Creates a Builder by copying an existing ResourceTypeMsg instance */
115     private Builder(gr.grnet.aquarium.message.avro.gen.ResourceTypeMsg other) {
116             super(gr.grnet.aquarium.message.avro.gen.ResourceTypeMsg.SCHEMA$);
117       if (isValidValue(fields()[0], other.name)) {
118         this.name = (java.lang.CharSequence) data().deepCopy(fields()[0].schema(), other.name);
119         fieldSetFlags()[0] = true;
120       }
121       if (isValidValue(fields()[1], other.unit)) {
122         this.unit = (java.lang.CharSequence) data().deepCopy(fields()[1].schema(), other.unit);
123         fieldSetFlags()[1] = true;
124       }
125       if (isValidValue(fields()[2], other.chargingBehaviorClass)) {
126         this.chargingBehaviorClass = (java.lang.CharSequence) data().deepCopy(fields()[2].schema(), other.chargingBehaviorClass);
127         fieldSetFlags()[2] = true;
128       }
129     }
130
131     /** Gets the value of the 'name' field */
132     public java.lang.CharSequence getName() {
133       return name;
134     }
135     
136     /** Sets the value of the 'name' field */
137     public gr.grnet.aquarium.message.avro.gen.ResourceTypeMsg.Builder setName(java.lang.CharSequence value) {
138       validate(fields()[0], value);
139       this.name = value;
140       fieldSetFlags()[0] = true;
141       return this; 
142     }
143     
144     /** Checks whether the 'name' field has been set */
145     public boolean hasName() {
146       return fieldSetFlags()[0];
147     }
148     
149     /** Clears the value of the 'name' field */
150     public gr.grnet.aquarium.message.avro.gen.ResourceTypeMsg.Builder clearName() {
151       name = null;
152       fieldSetFlags()[0] = false;
153       return this;
154     }
155
156     /** Gets the value of the 'unit' field */
157     public java.lang.CharSequence getUnit() {
158       return unit;
159     }
160     
161     /** Sets the value of the 'unit' field */
162     public gr.grnet.aquarium.message.avro.gen.ResourceTypeMsg.Builder setUnit(java.lang.CharSequence value) {
163       validate(fields()[1], value);
164       this.unit = value;
165       fieldSetFlags()[1] = true;
166       return this; 
167     }
168     
169     /** Checks whether the 'unit' field has been set */
170     public boolean hasUnit() {
171       return fieldSetFlags()[1];
172     }
173     
174     /** Clears the value of the 'unit' field */
175     public gr.grnet.aquarium.message.avro.gen.ResourceTypeMsg.Builder clearUnit() {
176       unit = null;
177       fieldSetFlags()[1] = false;
178       return this;
179     }
180
181     /** Gets the value of the 'chargingBehaviorClass' field */
182     public java.lang.CharSequence getChargingBehaviorClass() {
183       return chargingBehaviorClass;
184     }
185     
186     /** Sets the value of the 'chargingBehaviorClass' field */
187     public gr.grnet.aquarium.message.avro.gen.ResourceTypeMsg.Builder setChargingBehaviorClass(java.lang.CharSequence value) {
188       validate(fields()[2], value);
189       this.chargingBehaviorClass = value;
190       fieldSetFlags()[2] = true;
191       return this; 
192     }
193     
194     /** Checks whether the 'chargingBehaviorClass' field has been set */
195     public boolean hasChargingBehaviorClass() {
196       return fieldSetFlags()[2];
197     }
198     
199     /** Clears the value of the 'chargingBehaviorClass' field */
200     public gr.grnet.aquarium.message.avro.gen.ResourceTypeMsg.Builder clearChargingBehaviorClass() {
201       chargingBehaviorClass = null;
202       fieldSetFlags()[2] = false;
203       return this;
204     }
205
206     @Override
207     public ResourceTypeMsg build() {
208       try {
209         ResourceTypeMsg record = new ResourceTypeMsg();
210         record.name = fieldSetFlags()[0] ? this.name : (java.lang.CharSequence) defaultValue(fields()[0]);
211         record.unit = fieldSetFlags()[1] ? this.unit : (java.lang.CharSequence) defaultValue(fields()[1]);
212         record.chargingBehaviorClass = fieldSetFlags()[2] ? this.chargingBehaviorClass : (java.lang.CharSequence) defaultValue(fields()[2]);
213         return record;
214       } catch (Exception e) {
215         throw new org.apache.avro.AvroRuntimeException(e);
216       }
217     }
218   }
219 }