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\":\"originalID\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"inStoreID\",\"type\":[{\"type\":\"string\",\"avro.java.string\":\"String\"},\"null\"]},{\"name\":\"parentID\",\"type\":[{\"type\":\"string\",\"avro.java.string\":\"String\"},\"null\"]},{\"name\":\"validFromMillis\",\"type\":\"long\"},{\"name\":\"validToMillis\",\"type\":\"long\"},{\"name\":\"resourceMapping\",\"type\":{\"type\":\"map\",\"values\":{\"type\":\"record\",\"name\":\"ResourceTypeMsg\",\"fields\":[{\"name\":\"name\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"unit\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"chargingBehaviorClass\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}}]},\"avro.java.string\":\"String\"}},{\"name\":\"chargingBehaviors\",\"type\":{\"type\":\"array\",\"items\":{\"type\":\"string\",\"avro.java.string\":\"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\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"b\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}}]},\"null\"]}]}}}]},{\"type\":\"map\",\"values\":\"SelectorValueMsg\",\"avro.java.string\":\"String\"}]}]},\"avro.java.string\":\"String\"},\"avro.java.string\":\"String\"}}]},\"avro.java.string\":\"String\"}}]}");
10 @Deprecated public java.lang.String originalID;
11 @Deprecated public java.lang.String inStoreID;
12 @Deprecated public java.lang.String parentID;
13 @Deprecated public long validFromMillis;
14 @Deprecated public long validToMillis;
15 @Deprecated public java.util.Map<java.lang.String,gr.grnet.aquarium.message.avro.gen.ResourceTypeMsg> resourceMapping;
16 @Deprecated public java.util.List<java.lang.String> chargingBehaviors;
17 @Deprecated public java.util.Map<java.lang.String,gr.grnet.aquarium.message.avro.gen.FullPriceTableMsg> roleMapping;
18 public org.apache.avro.Schema getSchema() { return SCHEMA$; }
19 // Used by DatumWriter. Applications should not call.
20 public java.lang.Object get(int field$) {
22 case 0: return originalID;
23 case 1: return inStoreID;
24 case 2: return parentID;
25 case 3: return validFromMillis;
26 case 4: return validToMillis;
27 case 5: return resourceMapping;
28 case 6: return chargingBehaviors;
29 case 7: return roleMapping;
30 default: throw new org.apache.avro.AvroRuntimeException("Bad index");
33 // Used by DatumReader. Applications should not call.
34 @SuppressWarnings(value="unchecked")
35 public void put(int field$, java.lang.Object value$) {
37 case 0: originalID = (java.lang.String)value$; break;
38 case 1: inStoreID = (java.lang.String)value$; break;
39 case 2: parentID = (java.lang.String)value$; break;
40 case 3: validFromMillis = (java.lang.Long)value$; break;
41 case 4: validToMillis = (java.lang.Long)value$; break;
42 case 5: resourceMapping = (java.util.Map<java.lang.String,gr.grnet.aquarium.message.avro.gen.ResourceTypeMsg>)value$; break;
43 case 6: chargingBehaviors = (java.util.List<java.lang.String>)value$; break;
44 case 7: roleMapping = (java.util.Map<java.lang.String,gr.grnet.aquarium.message.avro.gen.FullPriceTableMsg>)value$; break;
45 default: throw new org.apache.avro.AvroRuntimeException("Bad index");
50 * Gets the value of the 'originalID' field.
52 public java.lang.String getOriginalID() {
57 * Sets the value of the 'originalID' field.
58 * @param value the value to set.
60 public void setOriginalID(java.lang.String value) {
61 this.originalID = value;
65 * Gets the value of the 'inStoreID' field.
67 public java.lang.String getInStoreID() {
72 * Sets the value of the 'inStoreID' field.
73 * @param value the value to set.
75 public void setInStoreID(java.lang.String value) {
76 this.inStoreID = value;
80 * Gets the value of the 'parentID' field.
82 public java.lang.String getParentID() {
87 * Sets the value of the 'parentID' field.
88 * @param value the value to set.
90 public void setParentID(java.lang.String value) {
91 this.parentID = value;
95 * Gets the value of the 'validFromMillis' field.
97 public java.lang.Long getValidFromMillis() {
98 return validFromMillis;
102 * Sets the value of the 'validFromMillis' field.
103 * @param value the value to set.
105 public void setValidFromMillis(java.lang.Long value) {
106 this.validFromMillis = value;
110 * Gets the value of the 'validToMillis' field.
112 public java.lang.Long getValidToMillis() {
113 return validToMillis;
117 * Sets the value of the 'validToMillis' field.
118 * @param value the value to set.
120 public void setValidToMillis(java.lang.Long value) {
121 this.validToMillis = value;
125 * Gets the value of the 'resourceMapping' field.
127 public java.util.Map<java.lang.String,gr.grnet.aquarium.message.avro.gen.ResourceTypeMsg> getResourceMapping() {
128 return resourceMapping;
132 * Sets the value of the 'resourceMapping' field.
133 * @param value the value to set.
135 public void setResourceMapping(java.util.Map<java.lang.String,gr.grnet.aquarium.message.avro.gen.ResourceTypeMsg> value) {
136 this.resourceMapping = value;
140 * Gets the value of the 'chargingBehaviors' field.
142 public java.util.List<java.lang.String> getChargingBehaviors() {
143 return chargingBehaviors;
147 * Sets the value of the 'chargingBehaviors' field.
148 * @param value the value to set.
150 public void setChargingBehaviors(java.util.List<java.lang.String> value) {
151 this.chargingBehaviors = value;
155 * Gets the value of the 'roleMapping' field.
157 public java.util.Map<java.lang.String,gr.grnet.aquarium.message.avro.gen.FullPriceTableMsg> getRoleMapping() {
162 * Sets the value of the 'roleMapping' field.
163 * @param value the value to set.
165 public void setRoleMapping(java.util.Map<java.lang.String,gr.grnet.aquarium.message.avro.gen.FullPriceTableMsg> value) {
166 this.roleMapping = value;
169 /** Creates a new PolicyMsg RecordBuilder */
170 public static gr.grnet.aquarium.message.avro.gen.PolicyMsg.Builder newBuilder() {
171 return new gr.grnet.aquarium.message.avro.gen.PolicyMsg.Builder();
174 /** Creates a new PolicyMsg RecordBuilder by copying an existing Builder */
175 public static gr.grnet.aquarium.message.avro.gen.PolicyMsg.Builder newBuilder(gr.grnet.aquarium.message.avro.gen.PolicyMsg.Builder other) {
176 return new gr.grnet.aquarium.message.avro.gen.PolicyMsg.Builder(other);
179 /** Creates a new PolicyMsg RecordBuilder by copying an existing PolicyMsg instance */
180 public static gr.grnet.aquarium.message.avro.gen.PolicyMsg.Builder newBuilder(gr.grnet.aquarium.message.avro.gen.PolicyMsg other) {
181 return new gr.grnet.aquarium.message.avro.gen.PolicyMsg.Builder(other);
185 * RecordBuilder for PolicyMsg instances.
187 public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<PolicyMsg>
188 implements org.apache.avro.data.RecordBuilder<PolicyMsg> {
190 private java.lang.String originalID;
191 private java.lang.String inStoreID;
192 private java.lang.String parentID;
193 private long validFromMillis;
194 private long validToMillis;
195 private java.util.Map<java.lang.String,gr.grnet.aquarium.message.avro.gen.ResourceTypeMsg> resourceMapping;
196 private java.util.List<java.lang.String> chargingBehaviors;
197 private java.util.Map<java.lang.String,gr.grnet.aquarium.message.avro.gen.FullPriceTableMsg> roleMapping;
199 /** Creates a new Builder */
201 super(gr.grnet.aquarium.message.avro.gen.PolicyMsg.SCHEMA$);
204 /** Creates a Builder by copying an existing Builder */
205 private Builder(gr.grnet.aquarium.message.avro.gen.PolicyMsg.Builder other) {
209 /** Creates a Builder by copying an existing PolicyMsg instance */
210 private Builder(gr.grnet.aquarium.message.avro.gen.PolicyMsg other) {
211 super(gr.grnet.aquarium.message.avro.gen.PolicyMsg.SCHEMA$);
212 if (isValidValue(fields()[0], other.originalID)) {
213 this.originalID = (java.lang.String) data().deepCopy(fields()[0].schema(), other.originalID);
214 fieldSetFlags()[0] = true;
216 if (isValidValue(fields()[1], other.inStoreID)) {
217 this.inStoreID = (java.lang.String) data().deepCopy(fields()[1].schema(), other.inStoreID);
218 fieldSetFlags()[1] = true;
220 if (isValidValue(fields()[2], other.parentID)) {
221 this.parentID = (java.lang.String) data().deepCopy(fields()[2].schema(), other.parentID);
222 fieldSetFlags()[2] = true;
224 if (isValidValue(fields()[3], other.validFromMillis)) {
225 this.validFromMillis = (java.lang.Long) data().deepCopy(fields()[3].schema(), other.validFromMillis);
226 fieldSetFlags()[3] = true;
228 if (isValidValue(fields()[4], other.validToMillis)) {
229 this.validToMillis = (java.lang.Long) data().deepCopy(fields()[4].schema(), other.validToMillis);
230 fieldSetFlags()[4] = true;
232 if (isValidValue(fields()[5], other.resourceMapping)) {
233 this.resourceMapping = (java.util.Map<java.lang.String,gr.grnet.aquarium.message.avro.gen.ResourceTypeMsg>) data().deepCopy(fields()[5].schema(), other.resourceMapping);
234 fieldSetFlags()[5] = true;
236 if (isValidValue(fields()[6], other.chargingBehaviors)) {
237 this.chargingBehaviors = (java.util.List<java.lang.String>) data().deepCopy(fields()[6].schema(), other.chargingBehaviors);
238 fieldSetFlags()[6] = true;
240 if (isValidValue(fields()[7], other.roleMapping)) {
241 this.roleMapping = (java.util.Map<java.lang.String,gr.grnet.aquarium.message.avro.gen.FullPriceTableMsg>) data().deepCopy(fields()[7].schema(), other.roleMapping);
242 fieldSetFlags()[7] = true;
246 /** Gets the value of the 'originalID' field */
247 public java.lang.String getOriginalID() {
251 /** Sets the value of the 'originalID' field */
252 public gr.grnet.aquarium.message.avro.gen.PolicyMsg.Builder setOriginalID(java.lang.String value) {
253 validate(fields()[0], value);
254 this.originalID = value;
255 fieldSetFlags()[0] = true;
259 /** Checks whether the 'originalID' field has been set */
260 public boolean hasOriginalID() {
261 return fieldSetFlags()[0];
264 /** Clears the value of the 'originalID' field */
265 public gr.grnet.aquarium.message.avro.gen.PolicyMsg.Builder clearOriginalID() {
267 fieldSetFlags()[0] = false;
271 /** Gets the value of the 'inStoreID' field */
272 public java.lang.String getInStoreID() {
276 /** Sets the value of the 'inStoreID' field */
277 public gr.grnet.aquarium.message.avro.gen.PolicyMsg.Builder setInStoreID(java.lang.String value) {
278 validate(fields()[1], value);
279 this.inStoreID = value;
280 fieldSetFlags()[1] = true;
284 /** Checks whether the 'inStoreID' field has been set */
285 public boolean hasInStoreID() {
286 return fieldSetFlags()[1];
289 /** Clears the value of the 'inStoreID' field */
290 public gr.grnet.aquarium.message.avro.gen.PolicyMsg.Builder clearInStoreID() {
292 fieldSetFlags()[1] = false;
296 /** Gets the value of the 'parentID' field */
297 public java.lang.String getParentID() {
301 /** Sets the value of the 'parentID' field */
302 public gr.grnet.aquarium.message.avro.gen.PolicyMsg.Builder setParentID(java.lang.String value) {
303 validate(fields()[2], value);
304 this.parentID = value;
305 fieldSetFlags()[2] = true;
309 /** Checks whether the 'parentID' field has been set */
310 public boolean hasParentID() {
311 return fieldSetFlags()[2];
314 /** Clears the value of the 'parentID' field */
315 public gr.grnet.aquarium.message.avro.gen.PolicyMsg.Builder clearParentID() {
317 fieldSetFlags()[2] = false;
321 /** Gets the value of the 'validFromMillis' field */
322 public java.lang.Long getValidFromMillis() {
323 return validFromMillis;
326 /** Sets the value of the 'validFromMillis' field */
327 public gr.grnet.aquarium.message.avro.gen.PolicyMsg.Builder setValidFromMillis(long value) {
328 validate(fields()[3], value);
329 this.validFromMillis = value;
330 fieldSetFlags()[3] = true;
334 /** Checks whether the 'validFromMillis' field has been set */
335 public boolean hasValidFromMillis() {
336 return fieldSetFlags()[3];
339 /** Clears the value of the 'validFromMillis' field */
340 public gr.grnet.aquarium.message.avro.gen.PolicyMsg.Builder clearValidFromMillis() {
341 fieldSetFlags()[3] = false;
345 /** Gets the value of the 'validToMillis' field */
346 public java.lang.Long getValidToMillis() {
347 return validToMillis;
350 /** Sets the value of the 'validToMillis' field */
351 public gr.grnet.aquarium.message.avro.gen.PolicyMsg.Builder setValidToMillis(long value) {
352 validate(fields()[4], value);
353 this.validToMillis = value;
354 fieldSetFlags()[4] = true;
358 /** Checks whether the 'validToMillis' field has been set */
359 public boolean hasValidToMillis() {
360 return fieldSetFlags()[4];
363 /** Clears the value of the 'validToMillis' field */
364 public gr.grnet.aquarium.message.avro.gen.PolicyMsg.Builder clearValidToMillis() {
365 fieldSetFlags()[4] = false;
369 /** Gets the value of the 'resourceMapping' field */
370 public java.util.Map<java.lang.String,gr.grnet.aquarium.message.avro.gen.ResourceTypeMsg> getResourceMapping() {
371 return resourceMapping;
374 /** Sets the value of the 'resourceMapping' field */
375 public gr.grnet.aquarium.message.avro.gen.PolicyMsg.Builder setResourceMapping(java.util.Map<java.lang.String,gr.grnet.aquarium.message.avro.gen.ResourceTypeMsg> value) {
376 validate(fields()[5], value);
377 this.resourceMapping = value;
378 fieldSetFlags()[5] = true;
382 /** Checks whether the 'resourceMapping' field has been set */
383 public boolean hasResourceMapping() {
384 return fieldSetFlags()[5];
387 /** Clears the value of the 'resourceMapping' field */
388 public gr.grnet.aquarium.message.avro.gen.PolicyMsg.Builder clearResourceMapping() {
389 resourceMapping = null;
390 fieldSetFlags()[5] = false;
394 /** Gets the value of the 'chargingBehaviors' field */
395 public java.util.List<java.lang.String> getChargingBehaviors() {
396 return chargingBehaviors;
399 /** Sets the value of the 'chargingBehaviors' field */
400 public gr.grnet.aquarium.message.avro.gen.PolicyMsg.Builder setChargingBehaviors(java.util.List<java.lang.String> value) {
401 validate(fields()[6], value);
402 this.chargingBehaviors = value;
403 fieldSetFlags()[6] = true;
407 /** Checks whether the 'chargingBehaviors' field has been set */
408 public boolean hasChargingBehaviors() {
409 return fieldSetFlags()[6];
412 /** Clears the value of the 'chargingBehaviors' field */
413 public gr.grnet.aquarium.message.avro.gen.PolicyMsg.Builder clearChargingBehaviors() {
414 chargingBehaviors = null;
415 fieldSetFlags()[6] = false;
419 /** Gets the value of the 'roleMapping' field */
420 public java.util.Map<java.lang.String,gr.grnet.aquarium.message.avro.gen.FullPriceTableMsg> getRoleMapping() {
424 /** Sets the value of the 'roleMapping' field */
425 public gr.grnet.aquarium.message.avro.gen.PolicyMsg.Builder setRoleMapping(java.util.Map<java.lang.String,gr.grnet.aquarium.message.avro.gen.FullPriceTableMsg> value) {
426 validate(fields()[7], value);
427 this.roleMapping = value;
428 fieldSetFlags()[7] = true;
432 /** Checks whether the 'roleMapping' field has been set */
433 public boolean hasRoleMapping() {
434 return fieldSetFlags()[7];
437 /** Clears the value of the 'roleMapping' field */
438 public gr.grnet.aquarium.message.avro.gen.PolicyMsg.Builder clearRoleMapping() {
440 fieldSetFlags()[7] = false;
445 public PolicyMsg build() {
447 PolicyMsg record = new PolicyMsg();
448 record.originalID = fieldSetFlags()[0] ? this.originalID : (java.lang.String) defaultValue(fields()[0]);
449 record.inStoreID = fieldSetFlags()[1] ? this.inStoreID : (java.lang.String) defaultValue(fields()[1]);
450 record.parentID = fieldSetFlags()[2] ? this.parentID : (java.lang.String) defaultValue(fields()[2]);
451 record.validFromMillis = fieldSetFlags()[3] ? this.validFromMillis : (java.lang.Long) defaultValue(fields()[3]);
452 record.validToMillis = fieldSetFlags()[4] ? this.validToMillis : (java.lang.Long) defaultValue(fields()[4]);
453 record.resourceMapping = fieldSetFlags()[5] ? this.resourceMapping : (java.util.Map<java.lang.String,gr.grnet.aquarium.message.avro.gen.ResourceTypeMsg>) defaultValue(fields()[5]);
454 record.chargingBehaviors = fieldSetFlags()[6] ? this.chargingBehaviors : (java.util.List<java.lang.String>) defaultValue(fields()[6]);
455 record.roleMapping = fieldSetFlags()[7] ? this.roleMapping : (java.util.Map<java.lang.String,gr.grnet.aquarium.message.avro.gen.FullPriceTableMsg>) defaultValue(fields()[7]);
457 } catch (Exception e) {
458 throw new org.apache.avro.AvroRuntimeException(e);