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\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"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;
20 * Default constructor.
25 * All-args constructor.
27 public PolicyMsg(java.lang.String originalID, java.lang.String inStoreID, java.lang.String parentID, java.lang.Long validFromMillis, java.lang.Long validToMillis, java.util.Map<java.lang.String,gr.grnet.aquarium.message.avro.gen.ResourceTypeMsg> resourceMapping, java.util.List<java.lang.String> chargingBehaviors, java.util.Map<java.lang.String,gr.grnet.aquarium.message.avro.gen.FullPriceTableMsg> roleMapping) {
28 this.originalID = originalID;
29 this.inStoreID = inStoreID;
30 this.parentID = parentID;
31 this.validFromMillis = validFromMillis;
32 this.validToMillis = validToMillis;
33 this.resourceMapping = resourceMapping;
34 this.chargingBehaviors = chargingBehaviors;
35 this.roleMapping = roleMapping;
38 public org.apache.avro.Schema getSchema() { return SCHEMA$; }
39 // Used by DatumWriter. Applications should not call.
40 public java.lang.Object get(int field$) {
42 case 0: return originalID;
43 case 1: return inStoreID;
44 case 2: return parentID;
45 case 3: return validFromMillis;
46 case 4: return validToMillis;
47 case 5: return resourceMapping;
48 case 6: return chargingBehaviors;
49 case 7: return roleMapping;
50 default: throw new org.apache.avro.AvroRuntimeException("Bad index");
53 // Used by DatumReader. Applications should not call.
54 @SuppressWarnings(value="unchecked")
55 public void put(int field$, java.lang.Object value$) {
57 case 0: originalID = (java.lang.String)value$; break;
58 case 1: inStoreID = (java.lang.String)value$; break;
59 case 2: parentID = (java.lang.String)value$; break;
60 case 3: validFromMillis = (java.lang.Long)value$; break;
61 case 4: validToMillis = (java.lang.Long)value$; break;
62 case 5: resourceMapping = (java.util.Map<java.lang.String,gr.grnet.aquarium.message.avro.gen.ResourceTypeMsg>)value$; break;
63 case 6: chargingBehaviors = (java.util.List<java.lang.String>)value$; break;
64 case 7: roleMapping = (java.util.Map<java.lang.String,gr.grnet.aquarium.message.avro.gen.FullPriceTableMsg>)value$; break;
65 default: throw new org.apache.avro.AvroRuntimeException("Bad index");
70 * Gets the value of the 'originalID' field.
72 public java.lang.String getOriginalID() {
77 * Sets the value of the 'originalID' field.
78 * @param value the value to set.
80 public void setOriginalID(java.lang.String value) {
81 this.originalID = value;
85 * Gets the value of the 'inStoreID' field.
87 public java.lang.String getInStoreID() {
92 * Sets the value of the 'inStoreID' field.
93 * @param value the value to set.
95 public void setInStoreID(java.lang.String value) {
96 this.inStoreID = value;
100 * Gets the value of the 'parentID' field.
102 public java.lang.String getParentID() {
107 * Sets the value of the 'parentID' field.
108 * @param value the value to set.
110 public void setParentID(java.lang.String value) {
111 this.parentID = value;
115 * Gets the value of the 'validFromMillis' field.
117 public java.lang.Long getValidFromMillis() {
118 return validFromMillis;
122 * Sets the value of the 'validFromMillis' field.
123 * @param value the value to set.
125 public void setValidFromMillis(java.lang.Long value) {
126 this.validFromMillis = value;
130 * Gets the value of the 'validToMillis' field.
132 public java.lang.Long getValidToMillis() {
133 return validToMillis;
137 * Sets the value of the 'validToMillis' field.
138 * @param value the value to set.
140 public void setValidToMillis(java.lang.Long value) {
141 this.validToMillis = value;
145 * Gets the value of the 'resourceMapping' field.
147 public java.util.Map<java.lang.String,gr.grnet.aquarium.message.avro.gen.ResourceTypeMsg> getResourceMapping() {
148 return resourceMapping;
152 * Sets the value of the 'resourceMapping' field.
153 * @param value the value to set.
155 public void setResourceMapping(java.util.Map<java.lang.String,gr.grnet.aquarium.message.avro.gen.ResourceTypeMsg> value) {
156 this.resourceMapping = value;
160 * Gets the value of the 'chargingBehaviors' field.
162 public java.util.List<java.lang.String> getChargingBehaviors() {
163 return chargingBehaviors;
167 * Sets the value of the 'chargingBehaviors' field.
168 * @param value the value to set.
170 public void setChargingBehaviors(java.util.List<java.lang.String> value) {
171 this.chargingBehaviors = value;
175 * Gets the value of the 'roleMapping' field.
177 public java.util.Map<java.lang.String,gr.grnet.aquarium.message.avro.gen.FullPriceTableMsg> getRoleMapping() {
182 * Sets the value of the 'roleMapping' field.
183 * @param value the value to set.
185 public void setRoleMapping(java.util.Map<java.lang.String,gr.grnet.aquarium.message.avro.gen.FullPriceTableMsg> value) {
186 this.roleMapping = value;
189 /** Creates a new PolicyMsg RecordBuilder */
190 public static gr.grnet.aquarium.message.avro.gen.PolicyMsg.Builder newBuilder() {
191 return new gr.grnet.aquarium.message.avro.gen.PolicyMsg.Builder();
194 /** Creates a new PolicyMsg RecordBuilder by copying an existing Builder */
195 public static gr.grnet.aquarium.message.avro.gen.PolicyMsg.Builder newBuilder(gr.grnet.aquarium.message.avro.gen.PolicyMsg.Builder other) {
196 return new gr.grnet.aquarium.message.avro.gen.PolicyMsg.Builder(other);
199 /** Creates a new PolicyMsg RecordBuilder by copying an existing PolicyMsg instance */
200 public static gr.grnet.aquarium.message.avro.gen.PolicyMsg.Builder newBuilder(gr.grnet.aquarium.message.avro.gen.PolicyMsg other) {
201 return new gr.grnet.aquarium.message.avro.gen.PolicyMsg.Builder(other);
205 * RecordBuilder for PolicyMsg instances.
207 public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<PolicyMsg>
208 implements org.apache.avro.data.RecordBuilder<PolicyMsg> {
210 private java.lang.String originalID;
211 private java.lang.String inStoreID;
212 private java.lang.String parentID;
213 private long validFromMillis;
214 private long validToMillis;
215 private java.util.Map<java.lang.String,gr.grnet.aquarium.message.avro.gen.ResourceTypeMsg> resourceMapping;
216 private java.util.List<java.lang.String> chargingBehaviors;
217 private java.util.Map<java.lang.String,gr.grnet.aquarium.message.avro.gen.FullPriceTableMsg> roleMapping;
219 /** Creates a new Builder */
221 super(gr.grnet.aquarium.message.avro.gen.PolicyMsg.SCHEMA$);
224 /** Creates a Builder by copying an existing Builder */
225 private Builder(gr.grnet.aquarium.message.avro.gen.PolicyMsg.Builder other) {
229 /** Creates a Builder by copying an existing PolicyMsg instance */
230 private Builder(gr.grnet.aquarium.message.avro.gen.PolicyMsg other) {
231 super(gr.grnet.aquarium.message.avro.gen.PolicyMsg.SCHEMA$);
232 if (isValidValue(fields()[0], other.originalID)) {
233 this.originalID = (java.lang.String) data().deepCopy(fields()[0].schema(), other.originalID);
234 fieldSetFlags()[0] = true;
236 if (isValidValue(fields()[1], other.inStoreID)) {
237 this.inStoreID = (java.lang.String) data().deepCopy(fields()[1].schema(), other.inStoreID);
238 fieldSetFlags()[1] = true;
240 if (isValidValue(fields()[2], other.parentID)) {
241 this.parentID = (java.lang.String) data().deepCopy(fields()[2].schema(), other.parentID);
242 fieldSetFlags()[2] = true;
244 if (isValidValue(fields()[3], other.validFromMillis)) {
245 this.validFromMillis = (java.lang.Long) data().deepCopy(fields()[3].schema(), other.validFromMillis);
246 fieldSetFlags()[3] = true;
248 if (isValidValue(fields()[4], other.validToMillis)) {
249 this.validToMillis = (java.lang.Long) data().deepCopy(fields()[4].schema(), other.validToMillis);
250 fieldSetFlags()[4] = true;
252 if (isValidValue(fields()[5], other.resourceMapping)) {
253 this.resourceMapping = (java.util.Map<java.lang.String,gr.grnet.aquarium.message.avro.gen.ResourceTypeMsg>) data().deepCopy(fields()[5].schema(), other.resourceMapping);
254 fieldSetFlags()[5] = true;
256 if (isValidValue(fields()[6], other.chargingBehaviors)) {
257 this.chargingBehaviors = (java.util.List<java.lang.String>) data().deepCopy(fields()[6].schema(), other.chargingBehaviors);
258 fieldSetFlags()[6] = true;
260 if (isValidValue(fields()[7], other.roleMapping)) {
261 this.roleMapping = (java.util.Map<java.lang.String,gr.grnet.aquarium.message.avro.gen.FullPriceTableMsg>) data().deepCopy(fields()[7].schema(), other.roleMapping);
262 fieldSetFlags()[7] = true;
266 /** Gets the value of the 'originalID' field */
267 public java.lang.String getOriginalID() {
271 /** Sets the value of the 'originalID' field */
272 public gr.grnet.aquarium.message.avro.gen.PolicyMsg.Builder setOriginalID(java.lang.String value) {
273 validate(fields()[0], value);
274 this.originalID = value;
275 fieldSetFlags()[0] = true;
279 /** Checks whether the 'originalID' field has been set */
280 public boolean hasOriginalID() {
281 return fieldSetFlags()[0];
284 /** Clears the value of the 'originalID' field */
285 public gr.grnet.aquarium.message.avro.gen.PolicyMsg.Builder clearOriginalID() {
287 fieldSetFlags()[0] = false;
291 /** Gets the value of the 'inStoreID' field */
292 public java.lang.String getInStoreID() {
296 /** Sets the value of the 'inStoreID' field */
297 public gr.grnet.aquarium.message.avro.gen.PolicyMsg.Builder setInStoreID(java.lang.String value) {
298 validate(fields()[1], value);
299 this.inStoreID = value;
300 fieldSetFlags()[1] = true;
304 /** Checks whether the 'inStoreID' field has been set */
305 public boolean hasInStoreID() {
306 return fieldSetFlags()[1];
309 /** Clears the value of the 'inStoreID' field */
310 public gr.grnet.aquarium.message.avro.gen.PolicyMsg.Builder clearInStoreID() {
312 fieldSetFlags()[1] = false;
316 /** Gets the value of the 'parentID' field */
317 public java.lang.String getParentID() {
321 /** Sets the value of the 'parentID' field */
322 public gr.grnet.aquarium.message.avro.gen.PolicyMsg.Builder setParentID(java.lang.String value) {
323 validate(fields()[2], value);
324 this.parentID = value;
325 fieldSetFlags()[2] = true;
329 /** Checks whether the 'parentID' field has been set */
330 public boolean hasParentID() {
331 return fieldSetFlags()[2];
334 /** Clears the value of the 'parentID' field */
335 public gr.grnet.aquarium.message.avro.gen.PolicyMsg.Builder clearParentID() {
337 fieldSetFlags()[2] = false;
341 /** Gets the value of the 'validFromMillis' field */
342 public java.lang.Long getValidFromMillis() {
343 return validFromMillis;
346 /** Sets the value of the 'validFromMillis' field */
347 public gr.grnet.aquarium.message.avro.gen.PolicyMsg.Builder setValidFromMillis(long value) {
348 validate(fields()[3], value);
349 this.validFromMillis = value;
350 fieldSetFlags()[3] = true;
354 /** Checks whether the 'validFromMillis' field has been set */
355 public boolean hasValidFromMillis() {
356 return fieldSetFlags()[3];
359 /** Clears the value of the 'validFromMillis' field */
360 public gr.grnet.aquarium.message.avro.gen.PolicyMsg.Builder clearValidFromMillis() {
361 fieldSetFlags()[3] = false;
365 /** Gets the value of the 'validToMillis' field */
366 public java.lang.Long getValidToMillis() {
367 return validToMillis;
370 /** Sets the value of the 'validToMillis' field */
371 public gr.grnet.aquarium.message.avro.gen.PolicyMsg.Builder setValidToMillis(long value) {
372 validate(fields()[4], value);
373 this.validToMillis = value;
374 fieldSetFlags()[4] = true;
378 /** Checks whether the 'validToMillis' field has been set */
379 public boolean hasValidToMillis() {
380 return fieldSetFlags()[4];
383 /** Clears the value of the 'validToMillis' field */
384 public gr.grnet.aquarium.message.avro.gen.PolicyMsg.Builder clearValidToMillis() {
385 fieldSetFlags()[4] = false;
389 /** Gets the value of the 'resourceMapping' field */
390 public java.util.Map<java.lang.String,gr.grnet.aquarium.message.avro.gen.ResourceTypeMsg> getResourceMapping() {
391 return resourceMapping;
394 /** Sets the value of the 'resourceMapping' field */
395 public gr.grnet.aquarium.message.avro.gen.PolicyMsg.Builder setResourceMapping(java.util.Map<java.lang.String,gr.grnet.aquarium.message.avro.gen.ResourceTypeMsg> value) {
396 validate(fields()[5], value);
397 this.resourceMapping = value;
398 fieldSetFlags()[5] = true;
402 /** Checks whether the 'resourceMapping' field has been set */
403 public boolean hasResourceMapping() {
404 return fieldSetFlags()[5];
407 /** Clears the value of the 'resourceMapping' field */
408 public gr.grnet.aquarium.message.avro.gen.PolicyMsg.Builder clearResourceMapping() {
409 resourceMapping = null;
410 fieldSetFlags()[5] = false;
414 /** Gets the value of the 'chargingBehaviors' field */
415 public java.util.List<java.lang.String> getChargingBehaviors() {
416 return chargingBehaviors;
419 /** Sets the value of the 'chargingBehaviors' field */
420 public gr.grnet.aquarium.message.avro.gen.PolicyMsg.Builder setChargingBehaviors(java.util.List<java.lang.String> value) {
421 validate(fields()[6], value);
422 this.chargingBehaviors = value;
423 fieldSetFlags()[6] = true;
427 /** Checks whether the 'chargingBehaviors' field has been set */
428 public boolean hasChargingBehaviors() {
429 return fieldSetFlags()[6];
432 /** Clears the value of the 'chargingBehaviors' field */
433 public gr.grnet.aquarium.message.avro.gen.PolicyMsg.Builder clearChargingBehaviors() {
434 chargingBehaviors = null;
435 fieldSetFlags()[6] = false;
439 /** Gets the value of the 'roleMapping' field */
440 public java.util.Map<java.lang.String,gr.grnet.aquarium.message.avro.gen.FullPriceTableMsg> getRoleMapping() {
444 /** Sets the value of the 'roleMapping' field */
445 public gr.grnet.aquarium.message.avro.gen.PolicyMsg.Builder setRoleMapping(java.util.Map<java.lang.String,gr.grnet.aquarium.message.avro.gen.FullPriceTableMsg> value) {
446 validate(fields()[7], value);
447 this.roleMapping = value;
448 fieldSetFlags()[7] = true;
452 /** Checks whether the 'roleMapping' field has been set */
453 public boolean hasRoleMapping() {
454 return fieldSetFlags()[7];
457 /** Clears the value of the 'roleMapping' field */
458 public gr.grnet.aquarium.message.avro.gen.PolicyMsg.Builder clearRoleMapping() {
460 fieldSetFlags()[7] = false;
465 public PolicyMsg build() {
467 PolicyMsg record = new PolicyMsg();
468 record.originalID = fieldSetFlags()[0] ? this.originalID : (java.lang.String) defaultValue(fields()[0]);
469 record.inStoreID = fieldSetFlags()[1] ? this.inStoreID : (java.lang.String) defaultValue(fields()[1]);
470 record.parentID = fieldSetFlags()[2] ? this.parentID : (java.lang.String) defaultValue(fields()[2]);
471 record.validFromMillis = fieldSetFlags()[3] ? this.validFromMillis : (java.lang.Long) defaultValue(fields()[3]);
472 record.validToMillis = fieldSetFlags()[4] ? this.validToMillis : (java.lang.Long) defaultValue(fields()[4]);
473 record.resourceMapping = fieldSetFlags()[5] ? this.resourceMapping : (java.util.Map<java.lang.String,gr.grnet.aquarium.message.avro.gen.ResourceTypeMsg>) defaultValue(fields()[5]);
474 record.chargingBehaviors = fieldSetFlags()[6] ? this.chargingBehaviors : (java.util.List<java.lang.String>) defaultValue(fields()[6]);
475 record.roleMapping = fieldSetFlags()[7] ? this.roleMapping : (java.util.Map<java.lang.String,gr.grnet.aquarium.message.avro.gen.FullPriceTableMsg>) defaultValue(fields()[7]);
477 } catch (Exception e) {
478 throw new org.apache.avro.AvroRuntimeException(e);