2 * Autogenerated by Avro
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;
17 * Default constructor.
19 public ChargeslotMsg() {}
22 * All-args constructor.
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;
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$) {
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");
44 // Used by DatumReader. Applications should not call.
45 @SuppressWarnings(value="unchecked")
46 public void put(int field$, java.lang.Object value$) {
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");
58 * Gets the value of the 'startMillis' field.
60 public java.lang.Long getStartMillis() {
65 * Sets the value of the 'startMillis' field.
66 * @param value the value to set.
68 public void setStartMillis(java.lang.Long value) {
69 this.startMillis = value;
73 * Gets the value of the 'stopMillis' field.
75 public java.lang.Long getStopMillis() {
80 * Sets the value of the 'stopMillis' field.
81 * @param value the value to set.
83 public void setStopMillis(java.lang.Long value) {
84 this.stopMillis = value;
88 * Gets the value of the 'unitPrice' field.
90 public java.lang.String getUnitPrice() {
95 * Sets the value of the 'unitPrice' field.
96 * @param value the value to set.
98 public void setUnitPrice(java.lang.String value) {
99 this.unitPrice = value;
103 * Gets the value of the 'explanation' field.
105 public java.lang.String getExplanation() {
110 * Sets the value of the 'explanation' field.
111 * @param value the value to set.
113 public void setExplanation(java.lang.String value) {
114 this.explanation = value;
118 * Gets the value of the 'creditsToSubtract' field.
120 public java.lang.String getCreditsToSubtract() {
121 return creditsToSubtract;
125 * Sets the value of the 'creditsToSubtract' field.
126 * @param value the value to set.
128 public void setCreditsToSubtract(java.lang.String value) {
129 this.creditsToSubtract = value;
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();
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);
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);
148 * RecordBuilder for ChargeslotMsg instances.
150 public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<ChargeslotMsg>
151 implements org.apache.avro.data.RecordBuilder<ChargeslotMsg> {
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;
159 /** Creates a new Builder */
161 super(gr.grnet.aquarium.message.avro.gen.ChargeslotMsg.SCHEMA$);
164 /** Creates a Builder by copying an existing Builder */
165 private Builder(gr.grnet.aquarium.message.avro.gen.ChargeslotMsg.Builder other) {
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;
176 if (isValidValue(fields()[1], other.stopMillis)) {
177 this.stopMillis = (java.lang.Long) data().deepCopy(fields()[1].schema(), other.stopMillis);
178 fieldSetFlags()[1] = true;
180 if (isValidValue(fields()[2], other.unitPrice)) {
181 this.unitPrice = (java.lang.String) data().deepCopy(fields()[2].schema(), other.unitPrice);
182 fieldSetFlags()[2] = true;
184 if (isValidValue(fields()[3], other.explanation)) {
185 this.explanation = (java.lang.String) data().deepCopy(fields()[3].schema(), other.explanation);
186 fieldSetFlags()[3] = true;
188 if (isValidValue(fields()[4], other.creditsToSubtract)) {
189 this.creditsToSubtract = (java.lang.String) data().deepCopy(fields()[4].schema(), other.creditsToSubtract);
190 fieldSetFlags()[4] = true;
194 /** Gets the value of the 'startMillis' field */
195 public java.lang.Long getStartMillis() {
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;
207 /** Checks whether the 'startMillis' field has been set */
208 public boolean hasStartMillis() {
209 return fieldSetFlags()[0];
212 /** Clears the value of the 'startMillis' field */
213 public gr.grnet.aquarium.message.avro.gen.ChargeslotMsg.Builder clearStartMillis() {
214 fieldSetFlags()[0] = false;
218 /** Gets the value of the 'stopMillis' field */
219 public java.lang.Long getStopMillis() {
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;
231 /** Checks whether the 'stopMillis' field has been set */
232 public boolean hasStopMillis() {
233 return fieldSetFlags()[1];
236 /** Clears the value of the 'stopMillis' field */
237 public gr.grnet.aquarium.message.avro.gen.ChargeslotMsg.Builder clearStopMillis() {
238 fieldSetFlags()[1] = false;
242 /** Gets the value of the 'unitPrice' field */
243 public java.lang.String getUnitPrice() {
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;
255 /** Checks whether the 'unitPrice' field has been set */
256 public boolean hasUnitPrice() {
257 return fieldSetFlags()[2];
260 /** Clears the value of the 'unitPrice' field */
261 public gr.grnet.aquarium.message.avro.gen.ChargeslotMsg.Builder clearUnitPrice() {
263 fieldSetFlags()[2] = false;
267 /** Gets the value of the 'explanation' field */
268 public java.lang.String getExplanation() {
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;
280 /** Checks whether the 'explanation' field has been set */
281 public boolean hasExplanation() {
282 return fieldSetFlags()[3];
285 /** Clears the value of the 'explanation' field */
286 public gr.grnet.aquarium.message.avro.gen.ChargeslotMsg.Builder clearExplanation() {
288 fieldSetFlags()[3] = false;
292 /** Gets the value of the 'creditsToSubtract' field */
293 public java.lang.String getCreditsToSubtract() {
294 return creditsToSubtract;
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;
305 /** Checks whether the 'creditsToSubtract' field has been set */
306 public boolean hasCreditsToSubtract() {
307 return fieldSetFlags()[4];
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;
318 public ChargeslotMsg build() {
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]);
327 } catch (Exception e) {
328 throw new org.apache.avro.AvroRuntimeException(e);