Rename all messages
[aquarium] / src / main / java / gr / grnet / aquarium / message / avro / gen / ResourceEntryMsg.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 ResourceEntryMsg 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\":\"ResourceEntryMsg\",\"namespace\":\"gr.grnet.aquarium.message.avro.gen\",\"fields\":[{\"name\":\"resourceName\",\"type\":\"string\"},{\"name\":\"resourceType\",\"type\":\"string\"},{\"name\":\"unitName\",\"type\":\"string\"},{\"name\":\"totalCredits\",\"type\":\"string\"},{\"name\":\"details\",\"type\":{\"type\":\"array\",\"items\":{\"type\":\"record\",\"name\":\"EventEntryMsg\",\"fields\":[{\"name\":\"eventType\",\"type\":\"string\"},{\"name\":\"details\",\"type\":{\"type\":\"array\",\"items\":{\"type\":\"record\",\"name\":\"ChargeEntryMsg\",\"fields\":[{\"name\":\"id\",\"type\":\"string\"},{\"name\":\"unitPrice\",\"type\":\"string\"},{\"name\":\"startTime\",\"type\":\"string\"},{\"name\":\"endTime\",\"type\":\"string\"},{\"name\":\"ellapsedTime\",\"type\":\"string\"},{\"name\":\"credits\",\"type\":\"string\"}]}}}]}}}]}");
10   @Deprecated public java.lang.CharSequence resourceName;
11   @Deprecated public java.lang.CharSequence resourceType;
12   @Deprecated public java.lang.CharSequence unitName;
13   @Deprecated public java.lang.CharSequence totalCredits;
14   @Deprecated public java.util.List<gr.grnet.aquarium.message.avro.gen.EventEntryMsg> details;
15   public org.apache.avro.Schema getSchema() { return SCHEMA$; }
16   // Used by DatumWriter.  Applications should not call. 
17   public java.lang.Object get(int field$) {
18     switch (field$) {
19     case 0: return resourceName;
20     case 1: return resourceType;
21     case 2: return unitName;
22     case 3: return totalCredits;
23     case 4: return details;
24     default: throw new org.apache.avro.AvroRuntimeException("Bad index");
25     }
26   }
27   // Used by DatumReader.  Applications should not call. 
28   @SuppressWarnings(value="unchecked")
29   public void put(int field$, java.lang.Object value$) {
30     switch (field$) {
31     case 0: resourceName = (java.lang.CharSequence)value$; break;
32     case 1: resourceType = (java.lang.CharSequence)value$; break;
33     case 2: unitName = (java.lang.CharSequence)value$; break;
34     case 3: totalCredits = (java.lang.CharSequence)value$; break;
35     case 4: details = (java.util.List<gr.grnet.aquarium.message.avro.gen.EventEntryMsg>)value$; break;
36     default: throw new org.apache.avro.AvroRuntimeException("Bad index");
37     }
38   }
39
40   /**
41    * Gets the value of the 'resourceName' field.
42    */
43   public java.lang.CharSequence getResourceName() {
44     return resourceName;
45   }
46
47   /**
48    * Sets the value of the 'resourceName' field.
49    * @param value the value to set.
50    */
51   public void setResourceName(java.lang.CharSequence value) {
52     this.resourceName = value;
53   }
54
55   /**
56    * Gets the value of the 'resourceType' field.
57    */
58   public java.lang.CharSequence getResourceType() {
59     return resourceType;
60   }
61
62   /**
63    * Sets the value of the 'resourceType' field.
64    * @param value the value to set.
65    */
66   public void setResourceType(java.lang.CharSequence value) {
67     this.resourceType = value;
68   }
69
70   /**
71    * Gets the value of the 'unitName' field.
72    */
73   public java.lang.CharSequence getUnitName() {
74     return unitName;
75   }
76
77   /**
78    * Sets the value of the 'unitName' field.
79    * @param value the value to set.
80    */
81   public void setUnitName(java.lang.CharSequence value) {
82     this.unitName = value;
83   }
84
85   /**
86    * Gets the value of the 'totalCredits' field.
87    */
88   public java.lang.CharSequence getTotalCredits() {
89     return totalCredits;
90   }
91
92   /**
93    * Sets the value of the 'totalCredits' field.
94    * @param value the value to set.
95    */
96   public void setTotalCredits(java.lang.CharSequence value) {
97     this.totalCredits = value;
98   }
99
100   /**
101    * Gets the value of the 'details' field.
102    */
103   public java.util.List<gr.grnet.aquarium.message.avro.gen.EventEntryMsg> getDetails() {
104     return details;
105   }
106
107   /**
108    * Sets the value of the 'details' field.
109    * @param value the value to set.
110    */
111   public void setDetails(java.util.List<gr.grnet.aquarium.message.avro.gen.EventEntryMsg> value) {
112     this.details = value;
113   }
114
115   /** Creates a new ResourceEntryMsg RecordBuilder */
116   public static gr.grnet.aquarium.message.avro.gen.ResourceEntryMsg.Builder newBuilder() {
117     return new gr.grnet.aquarium.message.avro.gen.ResourceEntryMsg.Builder();
118   }
119   
120   /** Creates a new ResourceEntryMsg RecordBuilder by copying an existing Builder */
121   public static gr.grnet.aquarium.message.avro.gen.ResourceEntryMsg.Builder newBuilder(gr.grnet.aquarium.message.avro.gen.ResourceEntryMsg.Builder other) {
122     return new gr.grnet.aquarium.message.avro.gen.ResourceEntryMsg.Builder(other);
123   }
124   
125   /** Creates a new ResourceEntryMsg RecordBuilder by copying an existing ResourceEntryMsg instance */
126   public static gr.grnet.aquarium.message.avro.gen.ResourceEntryMsg.Builder newBuilder(gr.grnet.aquarium.message.avro.gen.ResourceEntryMsg other) {
127     return new gr.grnet.aquarium.message.avro.gen.ResourceEntryMsg.Builder(other);
128   }
129   
130   /**
131    * RecordBuilder for ResourceEntryMsg instances.
132    */
133   public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<ResourceEntryMsg>
134     implements org.apache.avro.data.RecordBuilder<ResourceEntryMsg> {
135
136     private java.lang.CharSequence resourceName;
137     private java.lang.CharSequence resourceType;
138     private java.lang.CharSequence unitName;
139     private java.lang.CharSequence totalCredits;
140     private java.util.List<gr.grnet.aquarium.message.avro.gen.EventEntryMsg> details;
141
142     /** Creates a new Builder */
143     private Builder() {
144       super(gr.grnet.aquarium.message.avro.gen.ResourceEntryMsg.SCHEMA$);
145     }
146     
147     /** Creates a Builder by copying an existing Builder */
148     private Builder(gr.grnet.aquarium.message.avro.gen.ResourceEntryMsg.Builder other) {
149       super(other);
150     }
151     
152     /** Creates a Builder by copying an existing ResourceEntryMsg instance */
153     private Builder(gr.grnet.aquarium.message.avro.gen.ResourceEntryMsg other) {
154             super(gr.grnet.aquarium.message.avro.gen.ResourceEntryMsg.SCHEMA$);
155       if (isValidValue(fields()[0], other.resourceName)) {
156         this.resourceName = (java.lang.CharSequence) data().deepCopy(fields()[0].schema(), other.resourceName);
157         fieldSetFlags()[0] = true;
158       }
159       if (isValidValue(fields()[1], other.resourceType)) {
160         this.resourceType = (java.lang.CharSequence) data().deepCopy(fields()[1].schema(), other.resourceType);
161         fieldSetFlags()[1] = true;
162       }
163       if (isValidValue(fields()[2], other.unitName)) {
164         this.unitName = (java.lang.CharSequence) data().deepCopy(fields()[2].schema(), other.unitName);
165         fieldSetFlags()[2] = true;
166       }
167       if (isValidValue(fields()[3], other.totalCredits)) {
168         this.totalCredits = (java.lang.CharSequence) data().deepCopy(fields()[3].schema(), other.totalCredits);
169         fieldSetFlags()[3] = true;
170       }
171       if (isValidValue(fields()[4], other.details)) {
172         this.details = (java.util.List<gr.grnet.aquarium.message.avro.gen.EventEntryMsg>) data().deepCopy(fields()[4].schema(), other.details);
173         fieldSetFlags()[4] = true;
174       }
175     }
176
177     /** Gets the value of the 'resourceName' field */
178     public java.lang.CharSequence getResourceName() {
179       return resourceName;
180     }
181     
182     /** Sets the value of the 'resourceName' field */
183     public gr.grnet.aquarium.message.avro.gen.ResourceEntryMsg.Builder setResourceName(java.lang.CharSequence value) {
184       validate(fields()[0], value);
185       this.resourceName = value;
186       fieldSetFlags()[0] = true;
187       return this; 
188     }
189     
190     /** Checks whether the 'resourceName' field has been set */
191     public boolean hasResourceName() {
192       return fieldSetFlags()[0];
193     }
194     
195     /** Clears the value of the 'resourceName' field */
196     public gr.grnet.aquarium.message.avro.gen.ResourceEntryMsg.Builder clearResourceName() {
197       resourceName = null;
198       fieldSetFlags()[0] = false;
199       return this;
200     }
201
202     /** Gets the value of the 'resourceType' field */
203     public java.lang.CharSequence getResourceType() {
204       return resourceType;
205     }
206     
207     /** Sets the value of the 'resourceType' field */
208     public gr.grnet.aquarium.message.avro.gen.ResourceEntryMsg.Builder setResourceType(java.lang.CharSequence value) {
209       validate(fields()[1], value);
210       this.resourceType = value;
211       fieldSetFlags()[1] = true;
212       return this; 
213     }
214     
215     /** Checks whether the 'resourceType' field has been set */
216     public boolean hasResourceType() {
217       return fieldSetFlags()[1];
218     }
219     
220     /** Clears the value of the 'resourceType' field */
221     public gr.grnet.aquarium.message.avro.gen.ResourceEntryMsg.Builder clearResourceType() {
222       resourceType = null;
223       fieldSetFlags()[1] = false;
224       return this;
225     }
226
227     /** Gets the value of the 'unitName' field */
228     public java.lang.CharSequence getUnitName() {
229       return unitName;
230     }
231     
232     /** Sets the value of the 'unitName' field */
233     public gr.grnet.aquarium.message.avro.gen.ResourceEntryMsg.Builder setUnitName(java.lang.CharSequence value) {
234       validate(fields()[2], value);
235       this.unitName = value;
236       fieldSetFlags()[2] = true;
237       return this; 
238     }
239     
240     /** Checks whether the 'unitName' field has been set */
241     public boolean hasUnitName() {
242       return fieldSetFlags()[2];
243     }
244     
245     /** Clears the value of the 'unitName' field */
246     public gr.grnet.aquarium.message.avro.gen.ResourceEntryMsg.Builder clearUnitName() {
247       unitName = null;
248       fieldSetFlags()[2] = false;
249       return this;
250     }
251
252     /** Gets the value of the 'totalCredits' field */
253     public java.lang.CharSequence getTotalCredits() {
254       return totalCredits;
255     }
256     
257     /** Sets the value of the 'totalCredits' field */
258     public gr.grnet.aquarium.message.avro.gen.ResourceEntryMsg.Builder setTotalCredits(java.lang.CharSequence value) {
259       validate(fields()[3], value);
260       this.totalCredits = value;
261       fieldSetFlags()[3] = true;
262       return this; 
263     }
264     
265     /** Checks whether the 'totalCredits' field has been set */
266     public boolean hasTotalCredits() {
267       return fieldSetFlags()[3];
268     }
269     
270     /** Clears the value of the 'totalCredits' field */
271     public gr.grnet.aquarium.message.avro.gen.ResourceEntryMsg.Builder clearTotalCredits() {
272       totalCredits = null;
273       fieldSetFlags()[3] = false;
274       return this;
275     }
276
277     /** Gets the value of the 'details' field */
278     public java.util.List<gr.grnet.aquarium.message.avro.gen.EventEntryMsg> getDetails() {
279       return details;
280     }
281     
282     /** Sets the value of the 'details' field */
283     public gr.grnet.aquarium.message.avro.gen.ResourceEntryMsg.Builder setDetails(java.util.List<gr.grnet.aquarium.message.avro.gen.EventEntryMsg> value) {
284       validate(fields()[4], value);
285       this.details = value;
286       fieldSetFlags()[4] = true;
287       return this; 
288     }
289     
290     /** Checks whether the 'details' field has been set */
291     public boolean hasDetails() {
292       return fieldSetFlags()[4];
293     }
294     
295     /** Clears the value of the 'details' field */
296     public gr.grnet.aquarium.message.avro.gen.ResourceEntryMsg.Builder clearDetails() {
297       details = null;
298       fieldSetFlags()[4] = false;
299       return this;
300     }
301
302     @Override
303     public ResourceEntryMsg build() {
304       try {
305         ResourceEntryMsg record = new ResourceEntryMsg();
306         record.resourceName = fieldSetFlags()[0] ? this.resourceName : (java.lang.CharSequence) defaultValue(fields()[0]);
307         record.resourceType = fieldSetFlags()[1] ? this.resourceType : (java.lang.CharSequence) defaultValue(fields()[1]);
308         record.unitName = fieldSetFlags()[2] ? this.unitName : (java.lang.CharSequence) defaultValue(fields()[2]);
309         record.totalCredits = fieldSetFlags()[3] ? this.totalCredits : (java.lang.CharSequence) defaultValue(fields()[3]);
310         record.details = fieldSetFlags()[4] ? this.details : (java.util.List<gr.grnet.aquarium.message.avro.gen.EventEntryMsg>) defaultValue(fields()[4]);
311         return record;
312       } catch (Exception e) {
313         throw new org.apache.avro.AvroRuntimeException(e);
314       }
315     }
316   }
317 }