2 * Autogenerated by Avro
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$) {
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");
27 // Used by DatumReader. Applications should not call.
28 @SuppressWarnings(value="unchecked")
29 public void put(int field$, java.lang.Object value$) {
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");
41 * Gets the value of the 'startMillis' field.
43 public java.lang.Long getStartMillis() {
48 * Sets the value of the 'startMillis' field.
49 * @param value the value to set.
51 public void setStartMillis(java.lang.Long value) {
52 this.startMillis = value;
56 * Gets the value of the 'stopMillis' field.
58 public java.lang.Long getStopMillis() {
63 * Sets the value of the 'stopMillis' field.
64 * @param value the value to set.
66 public void setStopMillis(java.lang.Long value) {
67 this.stopMillis = value;
71 * Gets the value of the 'unitPrice' field.
73 public java.lang.Double getUnitPrice() {
78 * Sets the value of the 'unitPrice' field.
79 * @param value the value to set.
81 public void setUnitPrice(java.lang.Double value) {
82 this.unitPrice = value;
86 * Gets the value of the 'explanation' field.
88 public java.lang.CharSequence getExplanation() {
93 * Sets the value of the 'explanation' field.
94 * @param value the value to set.
96 public void setExplanation(java.lang.CharSequence value) {
97 this.explanation = value;
101 * Gets the value of the 'creditsToSubtract' field.
103 public java.lang.Double getCreditsToSubtract() {
104 return creditsToSubtract;
108 * Sets the value of the 'creditsToSubtract' field.
109 * @param value the value to set.
111 public void setCreditsToSubtract(java.lang.Double value) {
112 this.creditsToSubtract = value;
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();
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);
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);
131 * RecordBuilder for _Chargeslot instances.
133 public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<_Chargeslot>
134 implements org.apache.avro.data.RecordBuilder<_Chargeslot> {
136 private long startMillis;
137 private long stopMillis;
138 private double unitPrice;
139 private java.lang.CharSequence explanation;
140 private double creditsToSubtract;
142 /** Creates a new Builder */
144 super(gr.grnet.aquarium.message.avro.gen._Chargeslot.SCHEMA$);
147 /** Creates a Builder by copying an existing Builder */
148 private Builder(gr.grnet.aquarium.message.avro.gen._Chargeslot.Builder other) {
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;
159 if (isValidValue(fields()[1], other.stopMillis)) {
160 this.stopMillis = (java.lang.Long) data().deepCopy(fields()[1].schema(), other.stopMillis);
161 fieldSetFlags()[1] = true;
163 if (isValidValue(fields()[2], other.unitPrice)) {
164 this.unitPrice = (java.lang.Double) data().deepCopy(fields()[2].schema(), other.unitPrice);
165 fieldSetFlags()[2] = true;
167 if (isValidValue(fields()[3], other.explanation)) {
168 this.explanation = (java.lang.CharSequence) data().deepCopy(fields()[3].schema(), other.explanation);
169 fieldSetFlags()[3] = true;
171 if (isValidValue(fields()[4], other.creditsToSubtract)) {
172 this.creditsToSubtract = (java.lang.Double) data().deepCopy(fields()[4].schema(), other.creditsToSubtract);
173 fieldSetFlags()[4] = true;
177 /** Gets the value of the 'startMillis' field */
178 public java.lang.Long getStartMillis() {
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;
190 /** Checks whether the 'startMillis' field has been set */
191 public boolean hasStartMillis() {
192 return fieldSetFlags()[0];
195 /** Clears the value of the 'startMillis' field */
196 public gr.grnet.aquarium.message.avro.gen._Chargeslot.Builder clearStartMillis() {
197 fieldSetFlags()[0] = false;
201 /** Gets the value of the 'stopMillis' field */
202 public java.lang.Long getStopMillis() {
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;
214 /** Checks whether the 'stopMillis' field has been set */
215 public boolean hasStopMillis() {
216 return fieldSetFlags()[1];
219 /** Clears the value of the 'stopMillis' field */
220 public gr.grnet.aquarium.message.avro.gen._Chargeslot.Builder clearStopMillis() {
221 fieldSetFlags()[1] = false;
225 /** Gets the value of the 'unitPrice' field */
226 public java.lang.Double getUnitPrice() {
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;
238 /** Checks whether the 'unitPrice' field has been set */
239 public boolean hasUnitPrice() {
240 return fieldSetFlags()[2];
243 /** Clears the value of the 'unitPrice' field */
244 public gr.grnet.aquarium.message.avro.gen._Chargeslot.Builder clearUnitPrice() {
245 fieldSetFlags()[2] = false;
249 /** Gets the value of the 'explanation' field */
250 public java.lang.CharSequence getExplanation() {
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;
262 /** Checks whether the 'explanation' field has been set */
263 public boolean hasExplanation() {
264 return fieldSetFlags()[3];
267 /** Clears the value of the 'explanation' field */
268 public gr.grnet.aquarium.message.avro.gen._Chargeslot.Builder clearExplanation() {
270 fieldSetFlags()[3] = false;
274 /** Gets the value of the 'creditsToSubtract' field */
275 public java.lang.Double getCreditsToSubtract() {
276 return creditsToSubtract;
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;
287 /** Checks whether the 'creditsToSubtract' field has been set */
288 public boolean hasCreditsToSubtract() {
289 return fieldSetFlags()[4];
292 /** Clears the value of the 'creditsToSubtract' field */
293 public gr.grnet.aquarium.message.avro.gen._Chargeslot.Builder clearCreditsToSubtract() {
294 fieldSetFlags()[4] = false;
299 public _Chargeslot build() {
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]);
308 } catch (Exception e) {
309 throw new org.apache.avro.AvroRuntimeException(e);