Rename conf to policy and make parentID optional (via null)
[aquarium] / src / main / java / gr / grnet / aquarium / message / avro / gen / _Chargeslot.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 _Chargeslot 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\":\"_Chargeslot\",\"namespace\":\"gr.grnet.aquarium.message.avro.gen\",\"fields\":[{\"name\":\"startMillis\",\"type\":\"long\"},{\"name\":\"stopMillis\",\"type\":\"long\"},{\"name\":\"unitPrice\",\"type\":\"double\"},{\"name\":\"explanation\",\"type\":\"string\",\"default\":\"\"},{\"name\":\"creditsToSubtract\",\"type\":\"double\"}]}");
10   @Deprecated public long startMillis;
11   @Deprecated public long stopMillis;
12   @Deprecated public double unitPrice;
13   @Deprecated public java.lang.CharSequence explanation;
14   @Deprecated public double creditsToSubtract;
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 startMillis;
20     case 1: return stopMillis;
21     case 2: return unitPrice;
22     case 3: return explanation;
23     case 4: return creditsToSubtract;
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: startMillis = (java.lang.Long)value$; break;
32     case 1: stopMillis = (java.lang.Long)value$; break;
33     case 2: unitPrice = (java.lang.Double)value$; break;
34     case 3: explanation = (java.lang.CharSequence)value$; break;
35     case 4: creditsToSubtract = (java.lang.Double)value$; break;
36     default: throw new org.apache.avro.AvroRuntimeException("Bad index");
37     }
38   }
39
40   /**
41    * Gets the value of the 'startMillis' field.
42    */
43   public java.lang.Long getStartMillis() {
44     return startMillis;
45   }
46
47   /**
48    * Sets the value of the 'startMillis' field.
49    * @param value the value to set.
50    */
51   public void setStartMillis(java.lang.Long value) {
52     this.startMillis = value;
53   }
54
55   /**
56    * Gets the value of the 'stopMillis' field.
57    */
58   public java.lang.Long getStopMillis() {
59     return stopMillis;
60   }
61
62   /**
63    * Sets the value of the 'stopMillis' field.
64    * @param value the value to set.
65    */
66   public void setStopMillis(java.lang.Long value) {
67     this.stopMillis = value;
68   }
69
70   /**
71    * Gets the value of the 'unitPrice' field.
72    */
73   public java.lang.Double getUnitPrice() {
74     return unitPrice;
75   }
76
77   /**
78    * Sets the value of the 'unitPrice' field.
79    * @param value the value to set.
80    */
81   public void setUnitPrice(java.lang.Double value) {
82     this.unitPrice = value;
83   }
84
85   /**
86    * Gets the value of the 'explanation' field.
87    */
88   public java.lang.CharSequence getExplanation() {
89     return explanation;
90   }
91
92   /**
93    * Sets the value of the 'explanation' field.
94    * @param value the value to set.
95    */
96   public void setExplanation(java.lang.CharSequence value) {
97     this.explanation = value;
98   }
99
100   /**
101    * Gets the value of the 'creditsToSubtract' field.
102    */
103   public java.lang.Double getCreditsToSubtract() {
104     return creditsToSubtract;
105   }
106
107   /**
108    * Sets the value of the 'creditsToSubtract' field.
109    * @param value the value to set.
110    */
111   public void setCreditsToSubtract(java.lang.Double value) {
112     this.creditsToSubtract = value;
113   }
114
115   /** Creates a new _Chargeslot RecordBuilder */
116   public static gr.grnet.aquarium.message.avro.gen._Chargeslot.Builder newBuilder() {
117     return new gr.grnet.aquarium.message.avro.gen._Chargeslot.Builder();
118   }
119   
120   /** Creates a new _Chargeslot RecordBuilder by copying an existing Builder */
121   public static gr.grnet.aquarium.message.avro.gen._Chargeslot.Builder newBuilder(gr.grnet.aquarium.message.avro.gen._Chargeslot.Builder other) {
122     return new gr.grnet.aquarium.message.avro.gen._Chargeslot.Builder(other);
123   }
124   
125   /** Creates a new _Chargeslot RecordBuilder by copying an existing _Chargeslot instance */
126   public static gr.grnet.aquarium.message.avro.gen._Chargeslot.Builder newBuilder(gr.grnet.aquarium.message.avro.gen._Chargeslot other) {
127     return new gr.grnet.aquarium.message.avro.gen._Chargeslot.Builder(other);
128   }
129   
130   /**
131    * RecordBuilder for _Chargeslot instances.
132    */
133   public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<_Chargeslot>
134     implements org.apache.avro.data.RecordBuilder<_Chargeslot> {
135
136     private long startMillis;
137     private long stopMillis;
138     private double unitPrice;
139     private java.lang.CharSequence explanation;
140     private double creditsToSubtract;
141
142     /** Creates a new Builder */
143     private Builder() {
144       super(gr.grnet.aquarium.message.avro.gen._Chargeslot.SCHEMA$);
145     }
146     
147     /** Creates a Builder by copying an existing Builder */
148     private Builder(gr.grnet.aquarium.message.avro.gen._Chargeslot.Builder other) {
149       super(other);
150     }
151     
152     /** Creates a Builder by copying an existing _Chargeslot instance */
153     private Builder(gr.grnet.aquarium.message.avro.gen._Chargeslot other) {
154             super(gr.grnet.aquarium.message.avro.gen._Chargeslot.SCHEMA$);
155       if (isValidValue(fields()[0], other.startMillis)) {
156         this.startMillis = (java.lang.Long) data().deepCopy(fields()[0].schema(), other.startMillis);
157         fieldSetFlags()[0] = true;
158       }
159       if (isValidValue(fields()[1], other.stopMillis)) {
160         this.stopMillis = (java.lang.Long) data().deepCopy(fields()[1].schema(), other.stopMillis);
161         fieldSetFlags()[1] = true;
162       }
163       if (isValidValue(fields()[2], other.unitPrice)) {
164         this.unitPrice = (java.lang.Double) data().deepCopy(fields()[2].schema(), other.unitPrice);
165         fieldSetFlags()[2] = true;
166       }
167       if (isValidValue(fields()[3], other.explanation)) {
168         this.explanation = (java.lang.CharSequence) data().deepCopy(fields()[3].schema(), other.explanation);
169         fieldSetFlags()[3] = true;
170       }
171       if (isValidValue(fields()[4], other.creditsToSubtract)) {
172         this.creditsToSubtract = (java.lang.Double) data().deepCopy(fields()[4].schema(), other.creditsToSubtract);
173         fieldSetFlags()[4] = true;
174       }
175     }
176
177     /** Gets the value of the 'startMillis' field */
178     public java.lang.Long getStartMillis() {
179       return startMillis;
180     }
181     
182     /** Sets the value of the 'startMillis' field */
183     public gr.grnet.aquarium.message.avro.gen._Chargeslot.Builder setStartMillis(long value) {
184       validate(fields()[0], value);
185       this.startMillis = value;
186       fieldSetFlags()[0] = true;
187       return this; 
188     }
189     
190     /** Checks whether the 'startMillis' field has been set */
191     public boolean hasStartMillis() {
192       return fieldSetFlags()[0];
193     }
194     
195     /** Clears the value of the 'startMillis' field */
196     public gr.grnet.aquarium.message.avro.gen._Chargeslot.Builder clearStartMillis() {
197       fieldSetFlags()[0] = false;
198       return this;
199     }
200
201     /** Gets the value of the 'stopMillis' field */
202     public java.lang.Long getStopMillis() {
203       return stopMillis;
204     }
205     
206     /** Sets the value of the 'stopMillis' field */
207     public gr.grnet.aquarium.message.avro.gen._Chargeslot.Builder setStopMillis(long value) {
208       validate(fields()[1], value);
209       this.stopMillis = value;
210       fieldSetFlags()[1] = true;
211       return this; 
212     }
213     
214     /** Checks whether the 'stopMillis' field has been set */
215     public boolean hasStopMillis() {
216       return fieldSetFlags()[1];
217     }
218     
219     /** Clears the value of the 'stopMillis' field */
220     public gr.grnet.aquarium.message.avro.gen._Chargeslot.Builder clearStopMillis() {
221       fieldSetFlags()[1] = false;
222       return this;
223     }
224
225     /** Gets the value of the 'unitPrice' field */
226     public java.lang.Double getUnitPrice() {
227       return unitPrice;
228     }
229     
230     /** Sets the value of the 'unitPrice' field */
231     public gr.grnet.aquarium.message.avro.gen._Chargeslot.Builder setUnitPrice(double value) {
232       validate(fields()[2], value);
233       this.unitPrice = value;
234       fieldSetFlags()[2] = true;
235       return this; 
236     }
237     
238     /** Checks whether the 'unitPrice' field has been set */
239     public boolean hasUnitPrice() {
240       return fieldSetFlags()[2];
241     }
242     
243     /** Clears the value of the 'unitPrice' field */
244     public gr.grnet.aquarium.message.avro.gen._Chargeslot.Builder clearUnitPrice() {
245       fieldSetFlags()[2] = false;
246       return this;
247     }
248
249     /** Gets the value of the 'explanation' field */
250     public java.lang.CharSequence getExplanation() {
251       return explanation;
252     }
253     
254     /** Sets the value of the 'explanation' field */
255     public gr.grnet.aquarium.message.avro.gen._Chargeslot.Builder setExplanation(java.lang.CharSequence value) {
256       validate(fields()[3], value);
257       this.explanation = value;
258       fieldSetFlags()[3] = true;
259       return this; 
260     }
261     
262     /** Checks whether the 'explanation' field has been set */
263     public boolean hasExplanation() {
264       return fieldSetFlags()[3];
265     }
266     
267     /** Clears the value of the 'explanation' field */
268     public gr.grnet.aquarium.message.avro.gen._Chargeslot.Builder clearExplanation() {
269       explanation = null;
270       fieldSetFlags()[3] = false;
271       return this;
272     }
273
274     /** Gets the value of the 'creditsToSubtract' field */
275     public java.lang.Double getCreditsToSubtract() {
276       return creditsToSubtract;
277     }
278     
279     /** Sets the value of the 'creditsToSubtract' field */
280     public gr.grnet.aquarium.message.avro.gen._Chargeslot.Builder setCreditsToSubtract(double value) {
281       validate(fields()[4], value);
282       this.creditsToSubtract = value;
283       fieldSetFlags()[4] = true;
284       return this; 
285     }
286     
287     /** Checks whether the 'creditsToSubtract' field has been set */
288     public boolean hasCreditsToSubtract() {
289       return fieldSetFlags()[4];
290     }
291     
292     /** Clears the value of the 'creditsToSubtract' field */
293     public gr.grnet.aquarium.message.avro.gen._Chargeslot.Builder clearCreditsToSubtract() {
294       fieldSetFlags()[4] = false;
295       return this;
296     }
297
298     @Override
299     public _Chargeslot build() {
300       try {
301         _Chargeslot record = new _Chargeslot();
302         record.startMillis = fieldSetFlags()[0] ? this.startMillis : (java.lang.Long) defaultValue(fields()[0]);
303         record.stopMillis = fieldSetFlags()[1] ? this.stopMillis : (java.lang.Long) defaultValue(fields()[1]);
304         record.unitPrice = fieldSetFlags()[2] ? this.unitPrice : (java.lang.Double) defaultValue(fields()[2]);
305         record.explanation = fieldSetFlags()[3] ? this.explanation : (java.lang.CharSequence) defaultValue(fields()[3]);
306         record.creditsToSubtract = fieldSetFlags()[4] ? this.creditsToSubtract : (java.lang.Double) defaultValue(fields()[4]);
307         return record;
308       } catch (Exception e) {
309         throw new org.apache.avro.AvroRuntimeException(e);
310       }
311     }
312   }
313 }