2 * Autogenerated by Avro
6 package gr.grnet.aquarium.message.avro.gen;
7 @SuppressWarnings("all")
8 public class ChargeEntryMsg 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\":\"ChargeEntryMsg\",\"namespace\":\"gr.grnet.aquarium.message.avro.gen\",\"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 id;
11 @Deprecated public java.lang.CharSequence unitPrice;
12 @Deprecated public java.lang.CharSequence startTime;
13 @Deprecated public java.lang.CharSequence endTime;
14 @Deprecated public java.lang.CharSequence ellapsedTime;
15 @Deprecated public java.lang.CharSequence credits;
16 public org.apache.avro.Schema getSchema() { return SCHEMA$; }
17 // Used by DatumWriter. Applications should not call.
18 public java.lang.Object get(int field$) {
21 case 1: return unitPrice;
22 case 2: return startTime;
23 case 3: return endTime;
24 case 4: return ellapsedTime;
25 case 5: return credits;
26 default: throw new org.apache.avro.AvroRuntimeException("Bad index");
29 // Used by DatumReader. Applications should not call.
30 @SuppressWarnings(value="unchecked")
31 public void put(int field$, java.lang.Object value$) {
33 case 0: id = (java.lang.CharSequence)value$; break;
34 case 1: unitPrice = (java.lang.CharSequence)value$; break;
35 case 2: startTime = (java.lang.CharSequence)value$; break;
36 case 3: endTime = (java.lang.CharSequence)value$; break;
37 case 4: ellapsedTime = (java.lang.CharSequence)value$; break;
38 case 5: credits = (java.lang.CharSequence)value$; break;
39 default: throw new org.apache.avro.AvroRuntimeException("Bad index");
44 * Gets the value of the 'id' field.
46 public java.lang.CharSequence getId() {
51 * Sets the value of the 'id' field.
52 * @param value the value to set.
54 public void setId(java.lang.CharSequence value) {
59 * Gets the value of the 'unitPrice' field.
61 public java.lang.CharSequence getUnitPrice() {
66 * Sets the value of the 'unitPrice' field.
67 * @param value the value to set.
69 public void setUnitPrice(java.lang.CharSequence value) {
70 this.unitPrice = value;
74 * Gets the value of the 'startTime' field.
76 public java.lang.CharSequence getStartTime() {
81 * Sets the value of the 'startTime' field.
82 * @param value the value to set.
84 public void setStartTime(java.lang.CharSequence value) {
85 this.startTime = value;
89 * Gets the value of the 'endTime' field.
91 public java.lang.CharSequence getEndTime() {
96 * Sets the value of the 'endTime' field.
97 * @param value the value to set.
99 public void setEndTime(java.lang.CharSequence value) {
100 this.endTime = value;
104 * Gets the value of the 'ellapsedTime' field.
106 public java.lang.CharSequence getEllapsedTime() {
111 * Sets the value of the 'ellapsedTime' field.
112 * @param value the value to set.
114 public void setEllapsedTime(java.lang.CharSequence value) {
115 this.ellapsedTime = value;
119 * Gets the value of the 'credits' field.
121 public java.lang.CharSequence getCredits() {
126 * Sets the value of the 'credits' field.
127 * @param value the value to set.
129 public void setCredits(java.lang.CharSequence value) {
130 this.credits = value;
133 /** Creates a new ChargeEntryMsg RecordBuilder */
134 public static gr.grnet.aquarium.message.avro.gen.ChargeEntryMsg.Builder newBuilder() {
135 return new gr.grnet.aquarium.message.avro.gen.ChargeEntryMsg.Builder();
138 /** Creates a new ChargeEntryMsg RecordBuilder by copying an existing Builder */
139 public static gr.grnet.aquarium.message.avro.gen.ChargeEntryMsg.Builder newBuilder(gr.grnet.aquarium.message.avro.gen.ChargeEntryMsg.Builder other) {
140 return new gr.grnet.aquarium.message.avro.gen.ChargeEntryMsg.Builder(other);
143 /** Creates a new ChargeEntryMsg RecordBuilder by copying an existing ChargeEntryMsg instance */
144 public static gr.grnet.aquarium.message.avro.gen.ChargeEntryMsg.Builder newBuilder(gr.grnet.aquarium.message.avro.gen.ChargeEntryMsg other) {
145 return new gr.grnet.aquarium.message.avro.gen.ChargeEntryMsg.Builder(other);
149 * RecordBuilder for ChargeEntryMsg instances.
151 public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<ChargeEntryMsg>
152 implements org.apache.avro.data.RecordBuilder<ChargeEntryMsg> {
154 private java.lang.CharSequence id;
155 private java.lang.CharSequence unitPrice;
156 private java.lang.CharSequence startTime;
157 private java.lang.CharSequence endTime;
158 private java.lang.CharSequence ellapsedTime;
159 private java.lang.CharSequence credits;
161 /** Creates a new Builder */
163 super(gr.grnet.aquarium.message.avro.gen.ChargeEntryMsg.SCHEMA$);
166 /** Creates a Builder by copying an existing Builder */
167 private Builder(gr.grnet.aquarium.message.avro.gen.ChargeEntryMsg.Builder other) {
171 /** Creates a Builder by copying an existing ChargeEntryMsg instance */
172 private Builder(gr.grnet.aquarium.message.avro.gen.ChargeEntryMsg other) {
173 super(gr.grnet.aquarium.message.avro.gen.ChargeEntryMsg.SCHEMA$);
174 if (isValidValue(fields()[0], other.id)) {
175 this.id = (java.lang.CharSequence) data().deepCopy(fields()[0].schema(), other.id);
176 fieldSetFlags()[0] = true;
178 if (isValidValue(fields()[1], other.unitPrice)) {
179 this.unitPrice = (java.lang.CharSequence) data().deepCopy(fields()[1].schema(), other.unitPrice);
180 fieldSetFlags()[1] = true;
182 if (isValidValue(fields()[2], other.startTime)) {
183 this.startTime = (java.lang.CharSequence) data().deepCopy(fields()[2].schema(), other.startTime);
184 fieldSetFlags()[2] = true;
186 if (isValidValue(fields()[3], other.endTime)) {
187 this.endTime = (java.lang.CharSequence) data().deepCopy(fields()[3].schema(), other.endTime);
188 fieldSetFlags()[3] = true;
190 if (isValidValue(fields()[4], other.ellapsedTime)) {
191 this.ellapsedTime = (java.lang.CharSequence) data().deepCopy(fields()[4].schema(), other.ellapsedTime);
192 fieldSetFlags()[4] = true;
194 if (isValidValue(fields()[5], other.credits)) {
195 this.credits = (java.lang.CharSequence) data().deepCopy(fields()[5].schema(), other.credits);
196 fieldSetFlags()[5] = true;
200 /** Gets the value of the 'id' field */
201 public java.lang.CharSequence getId() {
205 /** Sets the value of the 'id' field */
206 public gr.grnet.aquarium.message.avro.gen.ChargeEntryMsg.Builder setId(java.lang.CharSequence value) {
207 validate(fields()[0], value);
209 fieldSetFlags()[0] = true;
213 /** Checks whether the 'id' field has been set */
214 public boolean hasId() {
215 return fieldSetFlags()[0];
218 /** Clears the value of the 'id' field */
219 public gr.grnet.aquarium.message.avro.gen.ChargeEntryMsg.Builder clearId() {
221 fieldSetFlags()[0] = false;
225 /** Gets the value of the 'unitPrice' field */
226 public java.lang.CharSequence getUnitPrice() {
230 /** Sets the value of the 'unitPrice' field */
231 public gr.grnet.aquarium.message.avro.gen.ChargeEntryMsg.Builder setUnitPrice(java.lang.CharSequence value) {
232 validate(fields()[1], value);
233 this.unitPrice = value;
234 fieldSetFlags()[1] = true;
238 /** Checks whether the 'unitPrice' field has been set */
239 public boolean hasUnitPrice() {
240 return fieldSetFlags()[1];
243 /** Clears the value of the 'unitPrice' field */
244 public gr.grnet.aquarium.message.avro.gen.ChargeEntryMsg.Builder clearUnitPrice() {
246 fieldSetFlags()[1] = false;
250 /** Gets the value of the 'startTime' field */
251 public java.lang.CharSequence getStartTime() {
255 /** Sets the value of the 'startTime' field */
256 public gr.grnet.aquarium.message.avro.gen.ChargeEntryMsg.Builder setStartTime(java.lang.CharSequence value) {
257 validate(fields()[2], value);
258 this.startTime = value;
259 fieldSetFlags()[2] = true;
263 /** Checks whether the 'startTime' field has been set */
264 public boolean hasStartTime() {
265 return fieldSetFlags()[2];
268 /** Clears the value of the 'startTime' field */
269 public gr.grnet.aquarium.message.avro.gen.ChargeEntryMsg.Builder clearStartTime() {
271 fieldSetFlags()[2] = false;
275 /** Gets the value of the 'endTime' field */
276 public java.lang.CharSequence getEndTime() {
280 /** Sets the value of the 'endTime' field */
281 public gr.grnet.aquarium.message.avro.gen.ChargeEntryMsg.Builder setEndTime(java.lang.CharSequence value) {
282 validate(fields()[3], value);
283 this.endTime = value;
284 fieldSetFlags()[3] = true;
288 /** Checks whether the 'endTime' field has been set */
289 public boolean hasEndTime() {
290 return fieldSetFlags()[3];
293 /** Clears the value of the 'endTime' field */
294 public gr.grnet.aquarium.message.avro.gen.ChargeEntryMsg.Builder clearEndTime() {
296 fieldSetFlags()[3] = false;
300 /** Gets the value of the 'ellapsedTime' field */
301 public java.lang.CharSequence getEllapsedTime() {
305 /** Sets the value of the 'ellapsedTime' field */
306 public gr.grnet.aquarium.message.avro.gen.ChargeEntryMsg.Builder setEllapsedTime(java.lang.CharSequence value) {
307 validate(fields()[4], value);
308 this.ellapsedTime = value;
309 fieldSetFlags()[4] = true;
313 /** Checks whether the 'ellapsedTime' field has been set */
314 public boolean hasEllapsedTime() {
315 return fieldSetFlags()[4];
318 /** Clears the value of the 'ellapsedTime' field */
319 public gr.grnet.aquarium.message.avro.gen.ChargeEntryMsg.Builder clearEllapsedTime() {
321 fieldSetFlags()[4] = false;
325 /** Gets the value of the 'credits' field */
326 public java.lang.CharSequence getCredits() {
330 /** Sets the value of the 'credits' field */
331 public gr.grnet.aquarium.message.avro.gen.ChargeEntryMsg.Builder setCredits(java.lang.CharSequence value) {
332 validate(fields()[5], value);
333 this.credits = value;
334 fieldSetFlags()[5] = true;
338 /** Checks whether the 'credits' field has been set */
339 public boolean hasCredits() {
340 return fieldSetFlags()[5];
343 /** Clears the value of the 'credits' field */
344 public gr.grnet.aquarium.message.avro.gen.ChargeEntryMsg.Builder clearCredits() {
346 fieldSetFlags()[5] = false;
351 public ChargeEntryMsg build() {
353 ChargeEntryMsg record = new ChargeEntryMsg();
354 record.id = fieldSetFlags()[0] ? this.id : (java.lang.CharSequence) defaultValue(fields()[0]);
355 record.unitPrice = fieldSetFlags()[1] ? this.unitPrice : (java.lang.CharSequence) defaultValue(fields()[1]);
356 record.startTime = fieldSetFlags()[2] ? this.startTime : (java.lang.CharSequence) defaultValue(fields()[2]);
357 record.endTime = fieldSetFlags()[3] ? this.endTime : (java.lang.CharSequence) defaultValue(fields()[3]);
358 record.ellapsedTime = fieldSetFlags()[4] ? this.ellapsedTime : (java.lang.CharSequence) defaultValue(fields()[4]);
359 record.credits = fieldSetFlags()[5] ? this.credits : (java.lang.CharSequence) defaultValue(fields()[5]);
361 } catch (Exception e) {
362 throw new org.apache.avro.AvroRuntimeException(e);