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