ce8e7627dc6e4738fedc246f7c9d7ba124d8411c
[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\":\"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$) {
20     switch (field$) {
21     case 0: return ID;
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");
29     }
30   }
31   // Used by DatumReader.  Applications should not call. 
32   @SuppressWarnings(value="unchecked")
33   public void put(int field$, java.lang.Object value$) {
34     switch (field$) {
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");
43     }
44   }
45
46   /**
47    * Gets the value of the 'ID' field.
48    */
49   public java.lang.CharSequence getID() {
50     return ID;
51   }
52
53   /**
54    * Sets the value of the 'ID' field.
55    * @param value the value to set.
56    */
57   public void setID(java.lang.CharSequence value) {
58     this.ID = value;
59   }
60
61   /**
62    * Gets the value of the 'parentID' field.
63    */
64   public java.lang.CharSequence getParentID() {
65     return parentID;
66   }
67
68   /**
69    * Sets the value of the 'parentID' field.
70    * @param value the value to set.
71    */
72   public void setParentID(java.lang.CharSequence value) {
73     this.parentID = value;
74   }
75
76   /**
77    * Gets the value of the 'validFromMillis' field.
78    */
79   public java.lang.Long getValidFromMillis() {
80     return validFromMillis;
81   }
82
83   /**
84    * Sets the value of the 'validFromMillis' field.
85    * @param value the value to set.
86    */
87   public void setValidFromMillis(java.lang.Long value) {
88     this.validFromMillis = value;
89   }
90
91   /**
92    * Gets the value of the 'validToMillis' field.
93    */
94   public java.lang.Long getValidToMillis() {
95     return validToMillis;
96   }
97
98   /**
99    * Sets the value of the 'validToMillis' field.
100    * @param value the value to set.
101    */
102   public void setValidToMillis(java.lang.Long value) {
103     this.validToMillis = value;
104   }
105
106   /**
107    * Gets the value of the 'resourceTypes' field.
108    */
109   public java.util.List<gr.grnet.aquarium.message.avro.gen.ResourceTypeMsg> getResourceTypes() {
110     return resourceTypes;
111   }
112
113   /**
114    * Sets the value of the 'resourceTypes' field.
115    * @param value the value to set.
116    */
117   public void setResourceTypes(java.util.List<gr.grnet.aquarium.message.avro.gen.ResourceTypeMsg> value) {
118     this.resourceTypes = value;
119   }
120
121   /**
122    * Gets the value of the 'chargingBehaviors' field.
123    */
124   public java.util.List<java.lang.CharSequence> getChargingBehaviors() {
125     return chargingBehaviors;
126   }
127
128   /**
129    * Sets the value of the 'chargingBehaviors' field.
130    * @param value the value to set.
131    */
132   public void setChargingBehaviors(java.util.List<java.lang.CharSequence> value) {
133     this.chargingBehaviors = value;
134   }
135
136   /**
137    * Gets the value of the 'roleMapping' field.
138    */
139   public java.util.Map<java.lang.CharSequence,gr.grnet.aquarium.message.avro.gen.FullPriceTableMsg> getRoleMapping() {
140     return roleMapping;
141   }
142
143   /**
144    * Sets the value of the 'roleMapping' field.
145    * @param value the value to set.
146    */
147   public void setRoleMapping(java.util.Map<java.lang.CharSequence,gr.grnet.aquarium.message.avro.gen.FullPriceTableMsg> value) {
148     this.roleMapping = value;
149   }
150
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();
154   }
155   
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);
159   }
160   
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);
164   }
165   
166   /**
167    * RecordBuilder for PolicyMsg instances.
168    */
169   public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<PolicyMsg>
170     implements org.apache.avro.data.RecordBuilder<PolicyMsg> {
171
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;
179
180     /** Creates a new Builder */
181     private Builder() {
182       super(gr.grnet.aquarium.message.avro.gen.PolicyMsg.SCHEMA$);
183     }
184     
185     /** Creates a Builder by copying an existing Builder */
186     private Builder(gr.grnet.aquarium.message.avro.gen.PolicyMsg.Builder other) {
187       super(other);
188     }
189     
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;
196       }
197       if (isValidValue(fields()[1], other.parentID)) {
198         this.parentID = (java.lang.CharSequence) data().deepCopy(fields()[1].schema(), other.parentID);
199         fieldSetFlags()[1] = true;
200       }
201       if (isValidValue(fields()[2], other.validFromMillis)) {
202         this.validFromMillis = (java.lang.Long) data().deepCopy(fields()[2].schema(), other.validFromMillis);
203         fieldSetFlags()[2] = true;
204       }
205       if (isValidValue(fields()[3], other.validToMillis)) {
206         this.validToMillis = (java.lang.Long) data().deepCopy(fields()[3].schema(), other.validToMillis);
207         fieldSetFlags()[3] = true;
208       }
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;
212       }
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;
216       }
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;
220       }
221     }
222
223     /** Gets the value of the 'ID' field */
224     public java.lang.CharSequence getID() {
225       return ID;
226     }
227     
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);
231       this.ID = value;
232       fieldSetFlags()[0] = true;
233       return this; 
234     }
235     
236     /** Checks whether the 'ID' field has been set */
237     public boolean hasID() {
238       return fieldSetFlags()[0];
239     }
240     
241     /** Clears the value of the 'ID' field */
242     public gr.grnet.aquarium.message.avro.gen.PolicyMsg.Builder clearID() {
243       ID = null;
244       fieldSetFlags()[0] = false;
245       return this;
246     }
247
248     /** Gets the value of the 'parentID' field */
249     public java.lang.CharSequence getParentID() {
250       return parentID;
251     }
252     
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;
258       return this; 
259     }
260     
261     /** Checks whether the 'parentID' field has been set */
262     public boolean hasParentID() {
263       return fieldSetFlags()[1];
264     }
265     
266     /** Clears the value of the 'parentID' field */
267     public gr.grnet.aquarium.message.avro.gen.PolicyMsg.Builder clearParentID() {
268       parentID = null;
269       fieldSetFlags()[1] = false;
270       return this;
271     }
272
273     /** Gets the value of the 'validFromMillis' field */
274     public java.lang.Long getValidFromMillis() {
275       return validFromMillis;
276     }
277     
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;
283       return this; 
284     }
285     
286     /** Checks whether the 'validFromMillis' field has been set */
287     public boolean hasValidFromMillis() {
288       return fieldSetFlags()[2];
289     }
290     
291     /** Clears the value of the 'validFromMillis' field */
292     public gr.grnet.aquarium.message.avro.gen.PolicyMsg.Builder clearValidFromMillis() {
293       fieldSetFlags()[2] = false;
294       return this;
295     }
296
297     /** Gets the value of the 'validToMillis' field */
298     public java.lang.Long getValidToMillis() {
299       return validToMillis;
300     }
301     
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;
307       return this; 
308     }
309     
310     /** Checks whether the 'validToMillis' field has been set */
311     public boolean hasValidToMillis() {
312       return fieldSetFlags()[3];
313     }
314     
315     /** Clears the value of the 'validToMillis' field */
316     public gr.grnet.aquarium.message.avro.gen.PolicyMsg.Builder clearValidToMillis() {
317       fieldSetFlags()[3] = false;
318       return this;
319     }
320
321     /** Gets the value of the 'resourceTypes' field */
322     public java.util.List<gr.grnet.aquarium.message.avro.gen.ResourceTypeMsg> getResourceTypes() {
323       return resourceTypes;
324     }
325     
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;
331       return this; 
332     }
333     
334     /** Checks whether the 'resourceTypes' field has been set */
335     public boolean hasResourceTypes() {
336       return fieldSetFlags()[4];
337     }
338     
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;
343       return this;
344     }
345
346     /** Gets the value of the 'chargingBehaviors' field */
347     public java.util.List<java.lang.CharSequence> getChargingBehaviors() {
348       return chargingBehaviors;
349     }
350     
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;
356       return this; 
357     }
358     
359     /** Checks whether the 'chargingBehaviors' field has been set */
360     public boolean hasChargingBehaviors() {
361       return fieldSetFlags()[5];
362     }
363     
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;
368       return this;
369     }
370
371     /** Gets the value of the 'roleMapping' field */
372     public java.util.Map<java.lang.CharSequence,gr.grnet.aquarium.message.avro.gen.FullPriceTableMsg> getRoleMapping() {
373       return roleMapping;
374     }
375     
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;
381       return this; 
382     }
383     
384     /** Checks whether the 'roleMapping' field has been set */
385     public boolean hasRoleMapping() {
386       return fieldSetFlags()[6];
387     }
388     
389     /** Clears the value of the 'roleMapping' field */
390     public gr.grnet.aquarium.message.avro.gen.PolicyMsg.Builder clearRoleMapping() {
391       roleMapping = null;
392       fieldSetFlags()[6] = false;
393       return this;
394     }
395
396     @Override
397     public PolicyMsg build() {
398       try {
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]);
407         return record;
408       } catch (Exception e) {
409         throw new org.apache.avro.AvroRuntimeException(e);
410       }
411     }
412   }
413 }