2 * Autogenerated by Avro
6 package gr.grnet.aquarium.message.avro.gen;
7 @SuppressWarnings("all")
8 public class _EventEntry 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\":\"_EventEntry\",\"namespace\":\"gr.grnet.aquarium.message.avro.gen\",\"fields\":[{\"name\":\"eventType\",\"type\":\"string\"},{\"name\":\"details\",\"type\":{\"type\":\"array\",\"items\":{\"type\":\"record\",\"name\":\"_ChargeEntry\",\"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 eventType;
11 @Deprecated public java.util.List<gr.grnet.aquarium.message.avro.gen._ChargeEntry> details;
12 public org.apache.avro.Schema getSchema() { return SCHEMA$; }
13 // Used by DatumWriter. Applications should not call.
14 public java.lang.Object get(int field$) {
16 case 0: return eventType;
17 case 1: return details;
18 default: throw new org.apache.avro.AvroRuntimeException("Bad index");
21 // Used by DatumReader. Applications should not call.
22 @SuppressWarnings(value="unchecked")
23 public void put(int field$, java.lang.Object value$) {
25 case 0: eventType = (java.lang.CharSequence)value$; break;
26 case 1: details = (java.util.List<gr.grnet.aquarium.message.avro.gen._ChargeEntry>)value$; break;
27 default: throw new org.apache.avro.AvroRuntimeException("Bad index");
32 * Gets the value of the 'eventType' field.
34 public java.lang.CharSequence getEventType() {
39 * Sets the value of the 'eventType' field.
40 * @param value the value to set.
42 public void setEventType(java.lang.CharSequence value) {
43 this.eventType = value;
47 * Gets the value of the 'details' field.
49 public java.util.List<gr.grnet.aquarium.message.avro.gen._ChargeEntry> getDetails() {
54 * Sets the value of the 'details' field.
55 * @param value the value to set.
57 public void setDetails(java.util.List<gr.grnet.aquarium.message.avro.gen._ChargeEntry> value) {
61 /** Creates a new _EventEntry RecordBuilder */
62 public static gr.grnet.aquarium.message.avro.gen._EventEntry.Builder newBuilder() {
63 return new gr.grnet.aquarium.message.avro.gen._EventEntry.Builder();
66 /** Creates a new _EventEntry RecordBuilder by copying an existing Builder */
67 public static gr.grnet.aquarium.message.avro.gen._EventEntry.Builder newBuilder(gr.grnet.aquarium.message.avro.gen._EventEntry.Builder other) {
68 return new gr.grnet.aquarium.message.avro.gen._EventEntry.Builder(other);
71 /** Creates a new _EventEntry RecordBuilder by copying an existing _EventEntry instance */
72 public static gr.grnet.aquarium.message.avro.gen._EventEntry.Builder newBuilder(gr.grnet.aquarium.message.avro.gen._EventEntry other) {
73 return new gr.grnet.aquarium.message.avro.gen._EventEntry.Builder(other);
77 * RecordBuilder for _EventEntry instances.
79 public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<_EventEntry>
80 implements org.apache.avro.data.RecordBuilder<_EventEntry> {
82 private java.lang.CharSequence eventType;
83 private java.util.List<gr.grnet.aquarium.message.avro.gen._ChargeEntry> details;
85 /** Creates a new Builder */
87 super(gr.grnet.aquarium.message.avro.gen._EventEntry.SCHEMA$);
90 /** Creates a Builder by copying an existing Builder */
91 private Builder(gr.grnet.aquarium.message.avro.gen._EventEntry.Builder other) {
95 /** Creates a Builder by copying an existing _EventEntry instance */
96 private Builder(gr.grnet.aquarium.message.avro.gen._EventEntry other) {
97 super(gr.grnet.aquarium.message.avro.gen._EventEntry.SCHEMA$);
98 if (isValidValue(fields()[0], other.eventType)) {
99 this.eventType = (java.lang.CharSequence) data().deepCopy(fields()[0].schema(), other.eventType);
100 fieldSetFlags()[0] = true;
102 if (isValidValue(fields()[1], other.details)) {
103 this.details = (java.util.List<gr.grnet.aquarium.message.avro.gen._ChargeEntry>) data().deepCopy(fields()[1].schema(), other.details);
104 fieldSetFlags()[1] = true;
108 /** Gets the value of the 'eventType' field */
109 public java.lang.CharSequence getEventType() {
113 /** Sets the value of the 'eventType' field */
114 public gr.grnet.aquarium.message.avro.gen._EventEntry.Builder setEventType(java.lang.CharSequence value) {
115 validate(fields()[0], value);
116 this.eventType = value;
117 fieldSetFlags()[0] = true;
121 /** Checks whether the 'eventType' field has been set */
122 public boolean hasEventType() {
123 return fieldSetFlags()[0];
126 /** Clears the value of the 'eventType' field */
127 public gr.grnet.aquarium.message.avro.gen._EventEntry.Builder clearEventType() {
129 fieldSetFlags()[0] = false;
133 /** Gets the value of the 'details' field */
134 public java.util.List<gr.grnet.aquarium.message.avro.gen._ChargeEntry> getDetails() {
138 /** Sets the value of the 'details' field */
139 public gr.grnet.aquarium.message.avro.gen._EventEntry.Builder setDetails(java.util.List<gr.grnet.aquarium.message.avro.gen._ChargeEntry> value) {
140 validate(fields()[1], value);
141 this.details = value;
142 fieldSetFlags()[1] = true;
146 /** Checks whether the 'details' field has been set */
147 public boolean hasDetails() {
148 return fieldSetFlags()[1];
151 /** Clears the value of the 'details' field */
152 public gr.grnet.aquarium.message.avro.gen._EventEntry.Builder clearDetails() {
154 fieldSetFlags()[1] = false;
159 public _EventEntry build() {
161 _EventEntry record = new _EventEntry();
162 record.eventType = fieldSetFlags()[0] ? this.eventType : (java.lang.CharSequence) defaultValue(fields()[0]);
163 record.details = fieldSetFlags()[1] ? this.details : (java.util.List<gr.grnet.aquarium.message.avro.gen._ChargeEntry>) defaultValue(fields()[1]);
165 } catch (Exception e) {
166 throw new org.apache.avro.AvroRuntimeException(e);