2 * Autogenerated by Avro
6 package gr.grnet.aquarium.message.avro.gen;
7 @SuppressWarnings("all")
8 public class ResourceTypeMsg 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\":\"ResourceTypeMsg\",\"namespace\":\"gr.grnet.aquarium.message.avro.gen\",\"fields\":[{\"name\":\"name\",\"type\":\"string\"},{\"name\":\"unit\",\"type\":\"string\"},{\"name\":\"chargingBehaviorClass\",\"type\":\"string\"}]}");
10 @Deprecated public java.lang.CharSequence name;
11 @Deprecated public java.lang.CharSequence unit;
12 @Deprecated public java.lang.CharSequence chargingBehaviorClass;
13 public org.apache.avro.Schema getSchema() { return SCHEMA$; }
14 // Used by DatumWriter. Applications should not call.
15 public java.lang.Object get(int field$) {
19 case 2: return chargingBehaviorClass;
20 default: throw new org.apache.avro.AvroRuntimeException("Bad index");
23 // Used by DatumReader. Applications should not call.
24 @SuppressWarnings(value="unchecked")
25 public void put(int field$, java.lang.Object value$) {
27 case 0: name = (java.lang.CharSequence)value$; break;
28 case 1: unit = (java.lang.CharSequence)value$; break;
29 case 2: chargingBehaviorClass = (java.lang.CharSequence)value$; break;
30 default: throw new org.apache.avro.AvroRuntimeException("Bad index");
35 * Gets the value of the 'name' field.
37 public java.lang.CharSequence getName() {
42 * Sets the value of the 'name' field.
43 * @param value the value to set.
45 public void setName(java.lang.CharSequence value) {
50 * Gets the value of the 'unit' field.
52 public java.lang.CharSequence getUnit() {
57 * Sets the value of the 'unit' field.
58 * @param value the value to set.
60 public void setUnit(java.lang.CharSequence value) {
65 * Gets the value of the 'chargingBehaviorClass' field.
67 public java.lang.CharSequence getChargingBehaviorClass() {
68 return chargingBehaviorClass;
72 * Sets the value of the 'chargingBehaviorClass' field.
73 * @param value the value to set.
75 public void setChargingBehaviorClass(java.lang.CharSequence value) {
76 this.chargingBehaviorClass = value;
79 /** Creates a new ResourceTypeMsg RecordBuilder */
80 public static gr.grnet.aquarium.message.avro.gen.ResourceTypeMsg.Builder newBuilder() {
81 return new gr.grnet.aquarium.message.avro.gen.ResourceTypeMsg.Builder();
84 /** Creates a new ResourceTypeMsg RecordBuilder by copying an existing Builder */
85 public static gr.grnet.aquarium.message.avro.gen.ResourceTypeMsg.Builder newBuilder(gr.grnet.aquarium.message.avro.gen.ResourceTypeMsg.Builder other) {
86 return new gr.grnet.aquarium.message.avro.gen.ResourceTypeMsg.Builder(other);
89 /** Creates a new ResourceTypeMsg RecordBuilder by copying an existing ResourceTypeMsg instance */
90 public static gr.grnet.aquarium.message.avro.gen.ResourceTypeMsg.Builder newBuilder(gr.grnet.aquarium.message.avro.gen.ResourceTypeMsg other) {
91 return new gr.grnet.aquarium.message.avro.gen.ResourceTypeMsg.Builder(other);
95 * RecordBuilder for ResourceTypeMsg instances.
97 public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<ResourceTypeMsg>
98 implements org.apache.avro.data.RecordBuilder<ResourceTypeMsg> {
100 private java.lang.CharSequence name;
101 private java.lang.CharSequence unit;
102 private java.lang.CharSequence chargingBehaviorClass;
104 /** Creates a new Builder */
106 super(gr.grnet.aquarium.message.avro.gen.ResourceTypeMsg.SCHEMA$);
109 /** Creates a Builder by copying an existing Builder */
110 private Builder(gr.grnet.aquarium.message.avro.gen.ResourceTypeMsg.Builder other) {
114 /** Creates a Builder by copying an existing ResourceTypeMsg instance */
115 private Builder(gr.grnet.aquarium.message.avro.gen.ResourceTypeMsg other) {
116 super(gr.grnet.aquarium.message.avro.gen.ResourceTypeMsg.SCHEMA$);
117 if (isValidValue(fields()[0], other.name)) {
118 this.name = (java.lang.CharSequence) data().deepCopy(fields()[0].schema(), other.name);
119 fieldSetFlags()[0] = true;
121 if (isValidValue(fields()[1], other.unit)) {
122 this.unit = (java.lang.CharSequence) data().deepCopy(fields()[1].schema(), other.unit);
123 fieldSetFlags()[1] = true;
125 if (isValidValue(fields()[2], other.chargingBehaviorClass)) {
126 this.chargingBehaviorClass = (java.lang.CharSequence) data().deepCopy(fields()[2].schema(), other.chargingBehaviorClass);
127 fieldSetFlags()[2] = true;
131 /** Gets the value of the 'name' field */
132 public java.lang.CharSequence getName() {
136 /** Sets the value of the 'name' field */
137 public gr.grnet.aquarium.message.avro.gen.ResourceTypeMsg.Builder setName(java.lang.CharSequence value) {
138 validate(fields()[0], value);
140 fieldSetFlags()[0] = true;
144 /** Checks whether the 'name' field has been set */
145 public boolean hasName() {
146 return fieldSetFlags()[0];
149 /** Clears the value of the 'name' field */
150 public gr.grnet.aquarium.message.avro.gen.ResourceTypeMsg.Builder clearName() {
152 fieldSetFlags()[0] = false;
156 /** Gets the value of the 'unit' field */
157 public java.lang.CharSequence getUnit() {
161 /** Sets the value of the 'unit' field */
162 public gr.grnet.aquarium.message.avro.gen.ResourceTypeMsg.Builder setUnit(java.lang.CharSequence value) {
163 validate(fields()[1], value);
165 fieldSetFlags()[1] = true;
169 /** Checks whether the 'unit' field has been set */
170 public boolean hasUnit() {
171 return fieldSetFlags()[1];
174 /** Clears the value of the 'unit' field */
175 public gr.grnet.aquarium.message.avro.gen.ResourceTypeMsg.Builder clearUnit() {
177 fieldSetFlags()[1] = false;
181 /** Gets the value of the 'chargingBehaviorClass' field */
182 public java.lang.CharSequence getChargingBehaviorClass() {
183 return chargingBehaviorClass;
186 /** Sets the value of the 'chargingBehaviorClass' field */
187 public gr.grnet.aquarium.message.avro.gen.ResourceTypeMsg.Builder setChargingBehaviorClass(java.lang.CharSequence value) {
188 validate(fields()[2], value);
189 this.chargingBehaviorClass = value;
190 fieldSetFlags()[2] = true;
194 /** Checks whether the 'chargingBehaviorClass' field has been set */
195 public boolean hasChargingBehaviorClass() {
196 return fieldSetFlags()[2];
199 /** Clears the value of the 'chargingBehaviorClass' field */
200 public gr.grnet.aquarium.message.avro.gen.ResourceTypeMsg.Builder clearChargingBehaviorClass() {
201 chargingBehaviorClass = null;
202 fieldSetFlags()[2] = false;
207 public ResourceTypeMsg build() {
209 ResourceTypeMsg record = new ResourceTypeMsg();
210 record.name = fieldSetFlags()[0] ? this.name : (java.lang.CharSequence) defaultValue(fields()[0]);
211 record.unit = fieldSetFlags()[1] ? this.unit : (java.lang.CharSequence) defaultValue(fields()[1]);
212 record.chargingBehaviorClass = fieldSetFlags()[2] ? this.chargingBehaviorClass : (java.lang.CharSequence) defaultValue(fields()[2]);
214 } catch (Exception e) {
215 throw new org.apache.avro.AvroRuntimeException(e);