WIP: New state machine for message processing
[aquarium] / src / main / java / gr / grnet / aquarium / message / avro / gen / PolicyMsg.java
1 /**
2  * Autogenerated by Avro
3  * 
4  * DO NOT EDIT DIRECTLY
5  */
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$) {
21     switch (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");
31     }
32   }
33   // Used by DatumReader.  Applications should not call. 
34   @SuppressWarnings(value="unchecked")
35   public void put(int field$, java.lang.Object value$) {
36     switch (field$) {
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");
46     }
47   }
48
49   /**
50    * Gets the value of the 'originalID' field.
51    */
52   public java.lang.String getOriginalID() {
53     return originalID;
54   }
55
56   /**
57    * Sets the value of the 'originalID' field.
58    * @param value the value to set.
59    */
60   public void setOriginalID(java.lang.String value) {
61     this.originalID = value;
62   }
63
64   /**
65    * Gets the value of the 'inStoreID' field.
66    */
67   public java.lang.String getInStoreID() {
68     return inStoreID;
69   }
70
71   /**
72    * Sets the value of the 'inStoreID' field.
73    * @param value the value to set.
74    */
75   public void setInStoreID(java.lang.String value) {
76     this.inStoreID = value;
77   }
78
79   /**
80    * Gets the value of the 'parentID' field.
81    */
82   public java.lang.String getParentID() {
83     return parentID;
84   }
85
86   /**
87    * Sets the value of the 'parentID' field.
88    * @param value the value to set.
89    */
90   public void setParentID(java.lang.String value) {
91     this.parentID = value;
92   }
93
94   /**
95    * Gets the value of the 'validFromMillis' field.
96    */
97   public java.lang.Long getValidFromMillis() {
98     return validFromMillis;
99   }
100
101   /**
102    * Sets the value of the 'validFromMillis' field.
103    * @param value the value to set.
104    */
105   public void setValidFromMillis(java.lang.Long value) {
106     this.validFromMillis = value;
107   }
108
109   /**
110    * Gets the value of the 'validToMillis' field.
111    */
112   public java.lang.Long getValidToMillis() {
113     return validToMillis;
114   }
115
116   /**
117    * Sets the value of the 'validToMillis' field.
118    * @param value the value to set.
119    */
120   public void setValidToMillis(java.lang.Long value) {
121     this.validToMillis = value;
122   }
123
124   /**
125    * Gets the value of the 'resourceMapping' field.
126    */
127   public java.util.Map<java.lang.String,gr.grnet.aquarium.message.avro.gen.ResourceTypeMsg> getResourceMapping() {
128     return resourceMapping;
129   }
130
131   /**
132    * Sets the value of the 'resourceMapping' field.
133    * @param value the value to set.
134    */
135   public void setResourceMapping(java.util.Map<java.lang.String,gr.grnet.aquarium.message.avro.gen.ResourceTypeMsg> value) {
136     this.resourceMapping = value;
137   }
138
139   /**
140    * Gets the value of the 'chargingBehaviors' field.
141    */
142   public java.util.List<java.lang.String> getChargingBehaviors() {
143     return chargingBehaviors;
144   }
145
146   /**
147    * Sets the value of the 'chargingBehaviors' field.
148    * @param value the value to set.
149    */
150   public void setChargingBehaviors(java.util.List<java.lang.String> value) {
151     this.chargingBehaviors = value;
152   }
153
154   /**
155    * Gets the value of the 'roleMapping' field.
156    */
157   public java.util.Map<java.lang.String,gr.grnet.aquarium.message.avro.gen.FullPriceTableMsg> getRoleMapping() {
158     return roleMapping;
159   }
160
161   /**
162    * Sets the value of the 'roleMapping' field.
163    * @param value the value to set.
164    */
165   public void setRoleMapping(java.util.Map<java.lang.String,gr.grnet.aquarium.message.avro.gen.FullPriceTableMsg> value) {
166     this.roleMapping = value;
167   }
168
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();
172   }
173   
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);
177   }
178   
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);
182   }
183   
184   /**
185    * RecordBuilder for PolicyMsg instances.
186    */
187   public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<PolicyMsg>
188     implements org.apache.avro.data.RecordBuilder<PolicyMsg> {
189
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;
198
199     /** Creates a new Builder */
200     private Builder() {
201       super(gr.grnet.aquarium.message.avro.gen.PolicyMsg.SCHEMA$);
202     }
203     
204     /** Creates a Builder by copying an existing Builder */
205     private Builder(gr.grnet.aquarium.message.avro.gen.PolicyMsg.Builder other) {
206       super(other);
207     }
208     
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;
215       }
216       if (isValidValue(fields()[1], other.inStoreID)) {
217         this.inStoreID = (java.lang.String) data().deepCopy(fields()[1].schema(), other.inStoreID);
218         fieldSetFlags()[1] = true;
219       }
220       if (isValidValue(fields()[2], other.parentID)) {
221         this.parentID = (java.lang.String) data().deepCopy(fields()[2].schema(), other.parentID);
222         fieldSetFlags()[2] = true;
223       }
224       if (isValidValue(fields()[3], other.validFromMillis)) {
225         this.validFromMillis = (java.lang.Long) data().deepCopy(fields()[3].schema(), other.validFromMillis);
226         fieldSetFlags()[3] = true;
227       }
228       if (isValidValue(fields()[4], other.validToMillis)) {
229         this.validToMillis = (java.lang.Long) data().deepCopy(fields()[4].schema(), other.validToMillis);
230         fieldSetFlags()[4] = true;
231       }
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;
235       }
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;
239       }
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;
243       }
244     }
245
246     /** Gets the value of the 'originalID' field */
247     public java.lang.String getOriginalID() {
248       return originalID;
249     }
250     
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;
256       return this; 
257     }
258     
259     /** Checks whether the 'originalID' field has been set */
260     public boolean hasOriginalID() {
261       return fieldSetFlags()[0];
262     }
263     
264     /** Clears the value of the 'originalID' field */
265     public gr.grnet.aquarium.message.avro.gen.PolicyMsg.Builder clearOriginalID() {
266       originalID = null;
267       fieldSetFlags()[0] = false;
268       return this;
269     }
270
271     /** Gets the value of the 'inStoreID' field */
272     public java.lang.String getInStoreID() {
273       return inStoreID;
274     }
275     
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;
281       return this; 
282     }
283     
284     /** Checks whether the 'inStoreID' field has been set */
285     public boolean hasInStoreID() {
286       return fieldSetFlags()[1];
287     }
288     
289     /** Clears the value of the 'inStoreID' field */
290     public gr.grnet.aquarium.message.avro.gen.PolicyMsg.Builder clearInStoreID() {
291       inStoreID = null;
292       fieldSetFlags()[1] = false;
293       return this;
294     }
295
296     /** Gets the value of the 'parentID' field */
297     public java.lang.String getParentID() {
298       return parentID;
299     }
300     
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;
306       return this; 
307     }
308     
309     /** Checks whether the 'parentID' field has been set */
310     public boolean hasParentID() {
311       return fieldSetFlags()[2];
312     }
313     
314     /** Clears the value of the 'parentID' field */
315     public gr.grnet.aquarium.message.avro.gen.PolicyMsg.Builder clearParentID() {
316       parentID = null;
317       fieldSetFlags()[2] = false;
318       return this;
319     }
320
321     /** Gets the value of the 'validFromMillis' field */
322     public java.lang.Long getValidFromMillis() {
323       return validFromMillis;
324     }
325     
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;
331       return this; 
332     }
333     
334     /** Checks whether the 'validFromMillis' field has been set */
335     public boolean hasValidFromMillis() {
336       return fieldSetFlags()[3];
337     }
338     
339     /** Clears the value of the 'validFromMillis' field */
340     public gr.grnet.aquarium.message.avro.gen.PolicyMsg.Builder clearValidFromMillis() {
341       fieldSetFlags()[3] = false;
342       return this;
343     }
344
345     /** Gets the value of the 'validToMillis' field */
346     public java.lang.Long getValidToMillis() {
347       return validToMillis;
348     }
349     
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;
355       return this; 
356     }
357     
358     /** Checks whether the 'validToMillis' field has been set */
359     public boolean hasValidToMillis() {
360       return fieldSetFlags()[4];
361     }
362     
363     /** Clears the value of the 'validToMillis' field */
364     public gr.grnet.aquarium.message.avro.gen.PolicyMsg.Builder clearValidToMillis() {
365       fieldSetFlags()[4] = false;
366       return this;
367     }
368
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;
372     }
373     
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;
379       return this; 
380     }
381     
382     /** Checks whether the 'resourceMapping' field has been set */
383     public boolean hasResourceMapping() {
384       return fieldSetFlags()[5];
385     }
386     
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;
391       return this;
392     }
393
394     /** Gets the value of the 'chargingBehaviors' field */
395     public java.util.List<java.lang.String> getChargingBehaviors() {
396       return chargingBehaviors;
397     }
398     
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;
404       return this; 
405     }
406     
407     /** Checks whether the 'chargingBehaviors' field has been set */
408     public boolean hasChargingBehaviors() {
409       return fieldSetFlags()[6];
410     }
411     
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;
416       return this;
417     }
418
419     /** Gets the value of the 'roleMapping' field */
420     public java.util.Map<java.lang.String,gr.grnet.aquarium.message.avro.gen.FullPriceTableMsg> getRoleMapping() {
421       return roleMapping;
422     }
423     
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;
429       return this; 
430     }
431     
432     /** Checks whether the 'roleMapping' field has been set */
433     public boolean hasRoleMapping() {
434       return fieldSetFlags()[7];
435     }
436     
437     /** Clears the value of the 'roleMapping' field */
438     public gr.grnet.aquarium.message.avro.gen.PolicyMsg.Builder clearRoleMapping() {
439       roleMapping = null;
440       fieldSetFlags()[7] = false;
441       return this;
442     }
443
444     @Override
445     public PolicyMsg build() {
446       try {
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]);
456         return record;
457       } catch (Exception e) {
458         throw new org.apache.avro.AvroRuntimeException(e);
459       }
460     }
461   }
462 }