2 * Autogenerated by Avro
6 package gr.grnet.aquarium.message.avro.gen;
7 @SuppressWarnings("all")
8 public class PolicyMsg 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\":\"PolicyMsg\",\"namespace\":\"gr.grnet.aquarium.message.avro.gen\",\"fields\":[{\"name\":\"ID\",\"type\":\"string\",\"aliases\":[\"id, _id, idInStore, inStoreID\"]},{\"name\":\"parentID\",\"type\":[\"string\",\"null\"]},{\"name\":\"validFromMillis\",\"type\":\"long\"},{\"name\":\"validToMillis\",\"type\":\"long\"},{\"name\":\"resourceTypes\",\"type\":{\"type\":\"array\",\"items\":{\"type\":\"record\",\"name\":\"ResourceTypeMsg\",\"fields\":[{\"name\":\"name\",\"type\":\"string\"},{\"name\":\"unit\",\"type\":\"string\"},{\"name\":\"chargingBehaviorClass\",\"type\":\"string\"}]}}},{\"name\":\"chargingBehaviors\",\"type\":{\"type\":\"array\",\"items\":\"string\"}},{\"name\":\"roleMapping\",\"type\":{\"type\":\"map\",\"values\":{\"type\":\"record\",\"name\":\"FullPriceTableMsg\",\"fields\":[{\"name\":\"perResource\",\"type\":{\"type\":\"map\",\"values\":{\"type\":\"map\",\"values\":{\"type\":\"record\",\"name\":\"SelectorValueMsg\",\"fields\":[{\"name\":\"selectorValue\",\"type\":[{\"type\":\"record\",\"name\":\"EffectivePriceTableMsg\",\"fields\":[{\"name\":\"priceOverrides\",\"type\":{\"type\":\"array\",\"items\":{\"type\":\"record\",\"name\":\"EffectiveUnitPriceMsg\",\"fields\":[{\"name\":\"unitPrice\",\"type\":\"double\"},{\"name\":\"when\",\"type\":[{\"type\":\"record\",\"name\":\"CronSpecTupleMsg\",\"fields\":[{\"name\":\"a\",\"type\":\"string\"},{\"name\":\"b\",\"type\":\"string\"}]},\"null\"]}]}}}]},{\"type\":\"map\",\"values\":\"SelectorValueMsg\"}]}]}}}}]}}}]}");
10 @Deprecated public java.lang.CharSequence ID;
11 @Deprecated public java.lang.CharSequence parentID;
12 @Deprecated public long validFromMillis;
13 @Deprecated public long validToMillis;
14 @Deprecated public java.util.List<gr.grnet.aquarium.message.avro.gen.ResourceTypeMsg> resourceTypes;
15 @Deprecated public java.util.List<java.lang.CharSequence> chargingBehaviors;
16 @Deprecated public java.util.Map<java.lang.CharSequence,gr.grnet.aquarium.message.avro.gen.FullPriceTableMsg> roleMapping;
17 public org.apache.avro.Schema getSchema() { return SCHEMA$; }
18 // Used by DatumWriter. Applications should not call.
19 public java.lang.Object get(int field$) {
22 case 1: return parentID;
23 case 2: return validFromMillis;
24 case 3: return validToMillis;
25 case 4: return resourceTypes;
26 case 5: return chargingBehaviors;
27 case 6: return roleMapping;
28 default: throw new org.apache.avro.AvroRuntimeException("Bad index");
31 // Used by DatumReader. Applications should not call.
32 @SuppressWarnings(value="unchecked")
33 public void put(int field$, java.lang.Object value$) {
35 case 0: ID = (java.lang.CharSequence)value$; break;
36 case 1: parentID = (java.lang.CharSequence)value$; break;
37 case 2: validFromMillis = (java.lang.Long)value$; break;
38 case 3: validToMillis = (java.lang.Long)value$; break;
39 case 4: resourceTypes = (java.util.List<gr.grnet.aquarium.message.avro.gen.ResourceTypeMsg>)value$; break;
40 case 5: chargingBehaviors = (java.util.List<java.lang.CharSequence>)value$; break;
41 case 6: roleMapping = (java.util.Map<java.lang.CharSequence,gr.grnet.aquarium.message.avro.gen.FullPriceTableMsg>)value$; break;
42 default: throw new org.apache.avro.AvroRuntimeException("Bad index");
47 * Gets the value of the 'ID' field.
49 public java.lang.CharSequence getID() {
54 * Sets the value of the 'ID' field.
55 * @param value the value to set.
57 public void setID(java.lang.CharSequence value) {
62 * Gets the value of the 'parentID' field.
64 public java.lang.CharSequence getParentID() {
69 * Sets the value of the 'parentID' field.
70 * @param value the value to set.
72 public void setParentID(java.lang.CharSequence value) {
73 this.parentID = value;
77 * Gets the value of the 'validFromMillis' field.
79 public java.lang.Long getValidFromMillis() {
80 return validFromMillis;
84 * Sets the value of the 'validFromMillis' field.
85 * @param value the value to set.
87 public void setValidFromMillis(java.lang.Long value) {
88 this.validFromMillis = value;
92 * Gets the value of the 'validToMillis' field.
94 public java.lang.Long getValidToMillis() {
99 * Sets the value of the 'validToMillis' field.
100 * @param value the value to set.
102 public void setValidToMillis(java.lang.Long value) {
103 this.validToMillis = value;
107 * Gets the value of the 'resourceTypes' field.
109 public java.util.List<gr.grnet.aquarium.message.avro.gen.ResourceTypeMsg> getResourceTypes() {
110 return resourceTypes;
114 * Sets the value of the 'resourceTypes' field.
115 * @param value the value to set.
117 public void setResourceTypes(java.util.List<gr.grnet.aquarium.message.avro.gen.ResourceTypeMsg> value) {
118 this.resourceTypes = value;
122 * Gets the value of the 'chargingBehaviors' field.
124 public java.util.List<java.lang.CharSequence> getChargingBehaviors() {
125 return chargingBehaviors;
129 * Sets the value of the 'chargingBehaviors' field.
130 * @param value the value to set.
132 public void setChargingBehaviors(java.util.List<java.lang.CharSequence> value) {
133 this.chargingBehaviors = value;
137 * Gets the value of the 'roleMapping' field.
139 public java.util.Map<java.lang.CharSequence,gr.grnet.aquarium.message.avro.gen.FullPriceTableMsg> getRoleMapping() {
144 * Sets the value of the 'roleMapping' field.
145 * @param value the value to set.
147 public void setRoleMapping(java.util.Map<java.lang.CharSequence,gr.grnet.aquarium.message.avro.gen.FullPriceTableMsg> value) {
148 this.roleMapping = value;
151 /** Creates a new PolicyMsg RecordBuilder */
152 public static gr.grnet.aquarium.message.avro.gen.PolicyMsg.Builder newBuilder() {
153 return new gr.grnet.aquarium.message.avro.gen.PolicyMsg.Builder();
156 /** Creates a new PolicyMsg RecordBuilder by copying an existing Builder */
157 public static gr.grnet.aquarium.message.avro.gen.PolicyMsg.Builder newBuilder(gr.grnet.aquarium.message.avro.gen.PolicyMsg.Builder other) {
158 return new gr.grnet.aquarium.message.avro.gen.PolicyMsg.Builder(other);
161 /** Creates a new PolicyMsg RecordBuilder by copying an existing PolicyMsg instance */
162 public static gr.grnet.aquarium.message.avro.gen.PolicyMsg.Builder newBuilder(gr.grnet.aquarium.message.avro.gen.PolicyMsg other) {
163 return new gr.grnet.aquarium.message.avro.gen.PolicyMsg.Builder(other);
167 * RecordBuilder for PolicyMsg instances.
169 public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<PolicyMsg>
170 implements org.apache.avro.data.RecordBuilder<PolicyMsg> {
172 private java.lang.CharSequence ID;
173 private java.lang.CharSequence parentID;
174 private long validFromMillis;
175 private long validToMillis;
176 private java.util.List<gr.grnet.aquarium.message.avro.gen.ResourceTypeMsg> resourceTypes;
177 private java.util.List<java.lang.CharSequence> chargingBehaviors;
178 private java.util.Map<java.lang.CharSequence,gr.grnet.aquarium.message.avro.gen.FullPriceTableMsg> roleMapping;
180 /** Creates a new Builder */
182 super(gr.grnet.aquarium.message.avro.gen.PolicyMsg.SCHEMA$);
185 /** Creates a Builder by copying an existing Builder */
186 private Builder(gr.grnet.aquarium.message.avro.gen.PolicyMsg.Builder other) {
190 /** Creates a Builder by copying an existing PolicyMsg instance */
191 private Builder(gr.grnet.aquarium.message.avro.gen.PolicyMsg other) {
192 super(gr.grnet.aquarium.message.avro.gen.PolicyMsg.SCHEMA$);
193 if (isValidValue(fields()[0], other.ID)) {
194 this.ID = (java.lang.CharSequence) data().deepCopy(fields()[0].schema(), other.ID);
195 fieldSetFlags()[0] = true;
197 if (isValidValue(fields()[1], other.parentID)) {
198 this.parentID = (java.lang.CharSequence) data().deepCopy(fields()[1].schema(), other.parentID);
199 fieldSetFlags()[1] = true;
201 if (isValidValue(fields()[2], other.validFromMillis)) {
202 this.validFromMillis = (java.lang.Long) data().deepCopy(fields()[2].schema(), other.validFromMillis);
203 fieldSetFlags()[2] = true;
205 if (isValidValue(fields()[3], other.validToMillis)) {
206 this.validToMillis = (java.lang.Long) data().deepCopy(fields()[3].schema(), other.validToMillis);
207 fieldSetFlags()[3] = true;
209 if (isValidValue(fields()[4], other.resourceTypes)) {
210 this.resourceTypes = (java.util.List<gr.grnet.aquarium.message.avro.gen.ResourceTypeMsg>) data().deepCopy(fields()[4].schema(), other.resourceTypes);
211 fieldSetFlags()[4] = true;
213 if (isValidValue(fields()[5], other.chargingBehaviors)) {
214 this.chargingBehaviors = (java.util.List<java.lang.CharSequence>) data().deepCopy(fields()[5].schema(), other.chargingBehaviors);
215 fieldSetFlags()[5] = true;
217 if (isValidValue(fields()[6], other.roleMapping)) {
218 this.roleMapping = (java.util.Map<java.lang.CharSequence,gr.grnet.aquarium.message.avro.gen.FullPriceTableMsg>) data().deepCopy(fields()[6].schema(), other.roleMapping);
219 fieldSetFlags()[6] = true;
223 /** Gets the value of the 'ID' field */
224 public java.lang.CharSequence getID() {
228 /** Sets the value of the 'ID' field */
229 public gr.grnet.aquarium.message.avro.gen.PolicyMsg.Builder setID(java.lang.CharSequence value) {
230 validate(fields()[0], value);
232 fieldSetFlags()[0] = true;
236 /** Checks whether the 'ID' field has been set */
237 public boolean hasID() {
238 return fieldSetFlags()[0];
241 /** Clears the value of the 'ID' field */
242 public gr.grnet.aquarium.message.avro.gen.PolicyMsg.Builder clearID() {
244 fieldSetFlags()[0] = false;
248 /** Gets the value of the 'parentID' field */
249 public java.lang.CharSequence getParentID() {
253 /** Sets the value of the 'parentID' field */
254 public gr.grnet.aquarium.message.avro.gen.PolicyMsg.Builder setParentID(java.lang.CharSequence value) {
255 validate(fields()[1], value);
256 this.parentID = value;
257 fieldSetFlags()[1] = true;
261 /** Checks whether the 'parentID' field has been set */
262 public boolean hasParentID() {
263 return fieldSetFlags()[1];
266 /** Clears the value of the 'parentID' field */
267 public gr.grnet.aquarium.message.avro.gen.PolicyMsg.Builder clearParentID() {
269 fieldSetFlags()[1] = false;
273 /** Gets the value of the 'validFromMillis' field */
274 public java.lang.Long getValidFromMillis() {
275 return validFromMillis;
278 /** Sets the value of the 'validFromMillis' field */
279 public gr.grnet.aquarium.message.avro.gen.PolicyMsg.Builder setValidFromMillis(long value) {
280 validate(fields()[2], value);
281 this.validFromMillis = value;
282 fieldSetFlags()[2] = true;
286 /** Checks whether the 'validFromMillis' field has been set */
287 public boolean hasValidFromMillis() {
288 return fieldSetFlags()[2];
291 /** Clears the value of the 'validFromMillis' field */
292 public gr.grnet.aquarium.message.avro.gen.PolicyMsg.Builder clearValidFromMillis() {
293 fieldSetFlags()[2] = false;
297 /** Gets the value of the 'validToMillis' field */
298 public java.lang.Long getValidToMillis() {
299 return validToMillis;
302 /** Sets the value of the 'validToMillis' field */
303 public gr.grnet.aquarium.message.avro.gen.PolicyMsg.Builder setValidToMillis(long value) {
304 validate(fields()[3], value);
305 this.validToMillis = value;
306 fieldSetFlags()[3] = true;
310 /** Checks whether the 'validToMillis' field has been set */
311 public boolean hasValidToMillis() {
312 return fieldSetFlags()[3];
315 /** Clears the value of the 'validToMillis' field */
316 public gr.grnet.aquarium.message.avro.gen.PolicyMsg.Builder clearValidToMillis() {
317 fieldSetFlags()[3] = false;
321 /** Gets the value of the 'resourceTypes' field */
322 public java.util.List<gr.grnet.aquarium.message.avro.gen.ResourceTypeMsg> getResourceTypes() {
323 return resourceTypes;
326 /** Sets the value of the 'resourceTypes' field */
327 public gr.grnet.aquarium.message.avro.gen.PolicyMsg.Builder setResourceTypes(java.util.List<gr.grnet.aquarium.message.avro.gen.ResourceTypeMsg> value) {
328 validate(fields()[4], value);
329 this.resourceTypes = value;
330 fieldSetFlags()[4] = true;
334 /** Checks whether the 'resourceTypes' field has been set */
335 public boolean hasResourceTypes() {
336 return fieldSetFlags()[4];
339 /** Clears the value of the 'resourceTypes' field */
340 public gr.grnet.aquarium.message.avro.gen.PolicyMsg.Builder clearResourceTypes() {
341 resourceTypes = null;
342 fieldSetFlags()[4] = false;
346 /** Gets the value of the 'chargingBehaviors' field */
347 public java.util.List<java.lang.CharSequence> getChargingBehaviors() {
348 return chargingBehaviors;
351 /** Sets the value of the 'chargingBehaviors' field */
352 public gr.grnet.aquarium.message.avro.gen.PolicyMsg.Builder setChargingBehaviors(java.util.List<java.lang.CharSequence> value) {
353 validate(fields()[5], value);
354 this.chargingBehaviors = value;
355 fieldSetFlags()[5] = true;
359 /** Checks whether the 'chargingBehaviors' field has been set */
360 public boolean hasChargingBehaviors() {
361 return fieldSetFlags()[5];
364 /** Clears the value of the 'chargingBehaviors' field */
365 public gr.grnet.aquarium.message.avro.gen.PolicyMsg.Builder clearChargingBehaviors() {
366 chargingBehaviors = null;
367 fieldSetFlags()[5] = false;
371 /** Gets the value of the 'roleMapping' field */
372 public java.util.Map<java.lang.CharSequence,gr.grnet.aquarium.message.avro.gen.FullPriceTableMsg> getRoleMapping() {
376 /** Sets the value of the 'roleMapping' field */
377 public gr.grnet.aquarium.message.avro.gen.PolicyMsg.Builder setRoleMapping(java.util.Map<java.lang.CharSequence,gr.grnet.aquarium.message.avro.gen.FullPriceTableMsg> value) {
378 validate(fields()[6], value);
379 this.roleMapping = value;
380 fieldSetFlags()[6] = true;
384 /** Checks whether the 'roleMapping' field has been set */
385 public boolean hasRoleMapping() {
386 return fieldSetFlags()[6];
389 /** Clears the value of the 'roleMapping' field */
390 public gr.grnet.aquarium.message.avro.gen.PolicyMsg.Builder clearRoleMapping() {
392 fieldSetFlags()[6] = false;
397 public PolicyMsg build() {
399 PolicyMsg record = new PolicyMsg();
400 record.ID = fieldSetFlags()[0] ? this.ID : (java.lang.CharSequence) defaultValue(fields()[0]);
401 record.parentID = fieldSetFlags()[1] ? this.parentID : (java.lang.CharSequence) defaultValue(fields()[1]);
402 record.validFromMillis = fieldSetFlags()[2] ? this.validFromMillis : (java.lang.Long) defaultValue(fields()[2]);
403 record.validToMillis = fieldSetFlags()[3] ? this.validToMillis : (java.lang.Long) defaultValue(fields()[3]);
404 record.resourceTypes = fieldSetFlags()[4] ? this.resourceTypes : (java.util.List<gr.grnet.aquarium.message.avro.gen.ResourceTypeMsg>) defaultValue(fields()[4]);
405 record.chargingBehaviors = fieldSetFlags()[5] ? this.chargingBehaviors : (java.util.List<java.lang.CharSequence>) defaultValue(fields()[5]);
406 record.roleMapping = fieldSetFlags()[6] ? this.roleMapping : (java.util.Map<java.lang.CharSequence,gr.grnet.aquarium.message.avro.gen.FullPriceTableMsg>) defaultValue(fields()[6]);
408 } catch (Exception e) {
409 throw new org.apache.avro.AvroRuntimeException(e);