Change the representation of computed credit values
[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\":{\"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;
18
19   /**
20    * Default constructor.
21    */
22   public PolicyMsg() {}
23
24   /**
25    * All-args constructor.
26    */
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;
36   }
37
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$) {
41     switch (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");
51     }
52   }
53   // Used by DatumReader.  Applications should not call. 
54   @SuppressWarnings(value="unchecked")
55   public void put(int field$, java.lang.Object value$) {
56     switch (field$) {
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");
66     }
67   }
68
69   /**
70    * Gets the value of the 'originalID' field.
71    */
72   public java.lang.String getOriginalID() {
73     return originalID;
74   }
75
76   /**
77    * Sets the value of the 'originalID' field.
78    * @param value the value to set.
79    */
80   public void setOriginalID(java.lang.String value) {
81     this.originalID = value;
82   }
83
84   /**
85    * Gets the value of the 'inStoreID' field.
86    */
87   public java.lang.String getInStoreID() {
88     return inStoreID;
89   }
90
91   /**
92    * Sets the value of the 'inStoreID' field.
93    * @param value the value to set.
94    */
95   public void setInStoreID(java.lang.String value) {
96     this.inStoreID = value;
97   }
98
99   /**
100    * Gets the value of the 'parentID' field.
101    */
102   public java.lang.String getParentID() {
103     return parentID;
104   }
105
106   /**
107    * Sets the value of the 'parentID' field.
108    * @param value the value to set.
109    */
110   public void setParentID(java.lang.String value) {
111     this.parentID = value;
112   }
113
114   /**
115    * Gets the value of the 'validFromMillis' field.
116    */
117   public java.lang.Long getValidFromMillis() {
118     return validFromMillis;
119   }
120
121   /**
122    * Sets the value of the 'validFromMillis' field.
123    * @param value the value to set.
124    */
125   public void setValidFromMillis(java.lang.Long value) {
126     this.validFromMillis = value;
127   }
128
129   /**
130    * Gets the value of the 'validToMillis' field.
131    */
132   public java.lang.Long getValidToMillis() {
133     return validToMillis;
134   }
135
136   /**
137    * Sets the value of the 'validToMillis' field.
138    * @param value the value to set.
139    */
140   public void setValidToMillis(java.lang.Long value) {
141     this.validToMillis = value;
142   }
143
144   /**
145    * Gets the value of the 'resourceMapping' field.
146    */
147   public java.util.Map<java.lang.String,gr.grnet.aquarium.message.avro.gen.ResourceTypeMsg> getResourceMapping() {
148     return resourceMapping;
149   }
150
151   /**
152    * Sets the value of the 'resourceMapping' field.
153    * @param value the value to set.
154    */
155   public void setResourceMapping(java.util.Map<java.lang.String,gr.grnet.aquarium.message.avro.gen.ResourceTypeMsg> value) {
156     this.resourceMapping = value;
157   }
158
159   /**
160    * Gets the value of the 'chargingBehaviors' field.
161    */
162   public java.util.List<java.lang.String> getChargingBehaviors() {
163     return chargingBehaviors;
164   }
165
166   /**
167    * Sets the value of the 'chargingBehaviors' field.
168    * @param value the value to set.
169    */
170   public void setChargingBehaviors(java.util.List<java.lang.String> value) {
171     this.chargingBehaviors = value;
172   }
173
174   /**
175    * Gets the value of the 'roleMapping' field.
176    */
177   public java.util.Map<java.lang.String,gr.grnet.aquarium.message.avro.gen.FullPriceTableMsg> getRoleMapping() {
178     return roleMapping;
179   }
180
181   /**
182    * Sets the value of the 'roleMapping' field.
183    * @param value the value to set.
184    */
185   public void setRoleMapping(java.util.Map<java.lang.String,gr.grnet.aquarium.message.avro.gen.FullPriceTableMsg> value) {
186     this.roleMapping = value;
187   }
188
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();
192   }
193   
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);
197   }
198   
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);
202   }
203   
204   /**
205    * RecordBuilder for PolicyMsg instances.
206    */
207   public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<PolicyMsg>
208     implements org.apache.avro.data.RecordBuilder<PolicyMsg> {
209
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;
218
219     /** Creates a new Builder */
220     private Builder() {
221       super(gr.grnet.aquarium.message.avro.gen.PolicyMsg.SCHEMA$);
222     }
223     
224     /** Creates a Builder by copying an existing Builder */
225     private Builder(gr.grnet.aquarium.message.avro.gen.PolicyMsg.Builder other) {
226       super(other);
227     }
228     
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;
235       }
236       if (isValidValue(fields()[1], other.inStoreID)) {
237         this.inStoreID = (java.lang.String) data().deepCopy(fields()[1].schema(), other.inStoreID);
238         fieldSetFlags()[1] = true;
239       }
240       if (isValidValue(fields()[2], other.parentID)) {
241         this.parentID = (java.lang.String) data().deepCopy(fields()[2].schema(), other.parentID);
242         fieldSetFlags()[2] = true;
243       }
244       if (isValidValue(fields()[3], other.validFromMillis)) {
245         this.validFromMillis = (java.lang.Long) data().deepCopy(fields()[3].schema(), other.validFromMillis);
246         fieldSetFlags()[3] = true;
247       }
248       if (isValidValue(fields()[4], other.validToMillis)) {
249         this.validToMillis = (java.lang.Long) data().deepCopy(fields()[4].schema(), other.validToMillis);
250         fieldSetFlags()[4] = true;
251       }
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;
255       }
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;
259       }
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;
263       }
264     }
265
266     /** Gets the value of the 'originalID' field */
267     public java.lang.String getOriginalID() {
268       return originalID;
269     }
270     
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;
276       return this; 
277     }
278     
279     /** Checks whether the 'originalID' field has been set */
280     public boolean hasOriginalID() {
281       return fieldSetFlags()[0];
282     }
283     
284     /** Clears the value of the 'originalID' field */
285     public gr.grnet.aquarium.message.avro.gen.PolicyMsg.Builder clearOriginalID() {
286       originalID = null;
287       fieldSetFlags()[0] = false;
288       return this;
289     }
290
291     /** Gets the value of the 'inStoreID' field */
292     public java.lang.String getInStoreID() {
293       return inStoreID;
294     }
295     
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;
301       return this; 
302     }
303     
304     /** Checks whether the 'inStoreID' field has been set */
305     public boolean hasInStoreID() {
306       return fieldSetFlags()[1];
307     }
308     
309     /** Clears the value of the 'inStoreID' field */
310     public gr.grnet.aquarium.message.avro.gen.PolicyMsg.Builder clearInStoreID() {
311       inStoreID = null;
312       fieldSetFlags()[1] = false;
313       return this;
314     }
315
316     /** Gets the value of the 'parentID' field */
317     public java.lang.String getParentID() {
318       return parentID;
319     }
320     
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;
326       return this; 
327     }
328     
329     /** Checks whether the 'parentID' field has been set */
330     public boolean hasParentID() {
331       return fieldSetFlags()[2];
332     }
333     
334     /** Clears the value of the 'parentID' field */
335     public gr.grnet.aquarium.message.avro.gen.PolicyMsg.Builder clearParentID() {
336       parentID = null;
337       fieldSetFlags()[2] = false;
338       return this;
339     }
340
341     /** Gets the value of the 'validFromMillis' field */
342     public java.lang.Long getValidFromMillis() {
343       return validFromMillis;
344     }
345     
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;
351       return this; 
352     }
353     
354     /** Checks whether the 'validFromMillis' field has been set */
355     public boolean hasValidFromMillis() {
356       return fieldSetFlags()[3];
357     }
358     
359     /** Clears the value of the 'validFromMillis' field */
360     public gr.grnet.aquarium.message.avro.gen.PolicyMsg.Builder clearValidFromMillis() {
361       fieldSetFlags()[3] = false;
362       return this;
363     }
364
365     /** Gets the value of the 'validToMillis' field */
366     public java.lang.Long getValidToMillis() {
367       return validToMillis;
368     }
369     
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;
375       return this; 
376     }
377     
378     /** Checks whether the 'validToMillis' field has been set */
379     public boolean hasValidToMillis() {
380       return fieldSetFlags()[4];
381     }
382     
383     /** Clears the value of the 'validToMillis' field */
384     public gr.grnet.aquarium.message.avro.gen.PolicyMsg.Builder clearValidToMillis() {
385       fieldSetFlags()[4] = false;
386       return this;
387     }
388
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;
392     }
393     
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;
399       return this; 
400     }
401     
402     /** Checks whether the 'resourceMapping' field has been set */
403     public boolean hasResourceMapping() {
404       return fieldSetFlags()[5];
405     }
406     
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;
411       return this;
412     }
413
414     /** Gets the value of the 'chargingBehaviors' field */
415     public java.util.List<java.lang.String> getChargingBehaviors() {
416       return chargingBehaviors;
417     }
418     
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;
424       return this; 
425     }
426     
427     /** Checks whether the 'chargingBehaviors' field has been set */
428     public boolean hasChargingBehaviors() {
429       return fieldSetFlags()[6];
430     }
431     
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;
436       return this;
437     }
438
439     /** Gets the value of the 'roleMapping' field */
440     public java.util.Map<java.lang.String,gr.grnet.aquarium.message.avro.gen.FullPriceTableMsg> getRoleMapping() {
441       return roleMapping;
442     }
443     
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;
449       return this; 
450     }
451     
452     /** Checks whether the 'roleMapping' field has been set */
453     public boolean hasRoleMapping() {
454       return fieldSetFlags()[7];
455     }
456     
457     /** Clears the value of the 'roleMapping' field */
458     public gr.grnet.aquarium.message.avro.gen.PolicyMsg.Builder clearRoleMapping() {
459       roleMapping = null;
460       fieldSetFlags()[7] = false;
461       return this;
462     }
463
464     @Override
465     public PolicyMsg build() {
466       try {
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]);
476         return record;
477       } catch (Exception e) {
478         throw new org.apache.avro.AvroRuntimeException(e);
479       }
480     }
481   }
482 }