Now using schema-based messages
[aquarium] / src / main / java / gr / grnet / aquarium / message / avro / gen / UserAgreementMsg.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 UserAgreementMsg 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\":\"UserAgreementMsg\",\"namespace\":\"gr.grnet.aquarium.message.avro.gen\",\"fields\":[{\"name\":\"id\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"relatedIMEventOriginalID\",\"type\":[{\"type\":\"string\",\"avro.java.string\":\"String\"},\"null\"]},{\"name\":\"userID\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"validFromMillis\",\"type\":\"long\"},{\"name\":\"validToMillis\",\"type\":\"long\"},{\"name\":\"role\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"fullPriceTableRef\",\"type\":[{\"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\"}}]},\"null\"]}]}");
10   @Deprecated public java.lang.String id;
11   @Deprecated public java.lang.String relatedIMEventOriginalID;
12   @Deprecated public java.lang.String userID;
13   @Deprecated public long validFromMillis;
14   @Deprecated public long validToMillis;
15   @Deprecated public java.lang.String role;
16   @Deprecated public gr.grnet.aquarium.message.avro.gen.FullPriceTableMsg fullPriceTableRef;
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 relatedIMEventOriginalID;
23     case 2: return userID;
24     case 3: return validFromMillis;
25     case 4: return validToMillis;
26     case 5: return role;
27     case 6: return fullPriceTableRef;
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.String)value$; break;
36     case 1: relatedIMEventOriginalID = (java.lang.String)value$; break;
37     case 2: userID = (java.lang.String)value$; break;
38     case 3: validFromMillis = (java.lang.Long)value$; break;
39     case 4: validToMillis = (java.lang.Long)value$; break;
40     case 5: role = (java.lang.String)value$; break;
41     case 6: fullPriceTableRef = (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.String 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.String value) {
58     this.id = value;
59   }
60
61   /**
62    * Gets the value of the 'relatedIMEventOriginalID' field.
63    */
64   public java.lang.String getRelatedIMEventOriginalID() {
65     return relatedIMEventOriginalID;
66   }
67
68   /**
69    * Sets the value of the 'relatedIMEventOriginalID' field.
70    * @param value the value to set.
71    */
72   public void setRelatedIMEventOriginalID(java.lang.String value) {
73     this.relatedIMEventOriginalID = value;
74   }
75
76   /**
77    * Gets the value of the 'userID' field.
78    */
79   public java.lang.String getUserID() {
80     return userID;
81   }
82
83   /**
84    * Sets the value of the 'userID' field.
85    * @param value the value to set.
86    */
87   public void setUserID(java.lang.String value) {
88     this.userID = value;
89   }
90
91   /**
92    * Gets the value of the 'validFromMillis' field.
93    */
94   public java.lang.Long getValidFromMillis() {
95     return validFromMillis;
96   }
97
98   /**
99    * Sets the value of the 'validFromMillis' field.
100    * @param value the value to set.
101    */
102   public void setValidFromMillis(java.lang.Long value) {
103     this.validFromMillis = value;
104   }
105
106   /**
107    * Gets the value of the 'validToMillis' field.
108    */
109   public java.lang.Long getValidToMillis() {
110     return validToMillis;
111   }
112
113   /**
114    * Sets the value of the 'validToMillis' field.
115    * @param value the value to set.
116    */
117   public void setValidToMillis(java.lang.Long value) {
118     this.validToMillis = value;
119   }
120
121   /**
122    * Gets the value of the 'role' field.
123    */
124   public java.lang.String getRole() {
125     return role;
126   }
127
128   /**
129    * Sets the value of the 'role' field.
130    * @param value the value to set.
131    */
132   public void setRole(java.lang.String value) {
133     this.role = value;
134   }
135
136   /**
137    * Gets the value of the 'fullPriceTableRef' field.
138    */
139   public gr.grnet.aquarium.message.avro.gen.FullPriceTableMsg getFullPriceTableRef() {
140     return fullPriceTableRef;
141   }
142
143   /**
144    * Sets the value of the 'fullPriceTableRef' field.
145    * @param value the value to set.
146    */
147   public void setFullPriceTableRef(gr.grnet.aquarium.message.avro.gen.FullPriceTableMsg value) {
148     this.fullPriceTableRef = value;
149   }
150
151   /** Creates a new UserAgreementMsg RecordBuilder */
152   public static gr.grnet.aquarium.message.avro.gen.UserAgreementMsg.Builder newBuilder() {
153     return new gr.grnet.aquarium.message.avro.gen.UserAgreementMsg.Builder();
154   }
155   
156   /** Creates a new UserAgreementMsg RecordBuilder by copying an existing Builder */
157   public static gr.grnet.aquarium.message.avro.gen.UserAgreementMsg.Builder newBuilder(gr.grnet.aquarium.message.avro.gen.UserAgreementMsg.Builder other) {
158     return new gr.grnet.aquarium.message.avro.gen.UserAgreementMsg.Builder(other);
159   }
160   
161   /** Creates a new UserAgreementMsg RecordBuilder by copying an existing UserAgreementMsg instance */
162   public static gr.grnet.aquarium.message.avro.gen.UserAgreementMsg.Builder newBuilder(gr.grnet.aquarium.message.avro.gen.UserAgreementMsg other) {
163     return new gr.grnet.aquarium.message.avro.gen.UserAgreementMsg.Builder(other);
164   }
165   
166   /**
167    * RecordBuilder for UserAgreementMsg instances.
168    */
169   public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<UserAgreementMsg>
170     implements org.apache.avro.data.RecordBuilder<UserAgreementMsg> {
171
172     private java.lang.String id;
173     private java.lang.String relatedIMEventOriginalID;
174     private java.lang.String userID;
175     private long validFromMillis;
176     private long validToMillis;
177     private java.lang.String role;
178     private gr.grnet.aquarium.message.avro.gen.FullPriceTableMsg fullPriceTableRef;
179
180     /** Creates a new Builder */
181     private Builder() {
182       super(gr.grnet.aquarium.message.avro.gen.UserAgreementMsg.SCHEMA$);
183     }
184     
185     /** Creates a Builder by copying an existing Builder */
186     private Builder(gr.grnet.aquarium.message.avro.gen.UserAgreementMsg.Builder other) {
187       super(other);
188     }
189     
190     /** Creates a Builder by copying an existing UserAgreementMsg instance */
191     private Builder(gr.grnet.aquarium.message.avro.gen.UserAgreementMsg other) {
192             super(gr.grnet.aquarium.message.avro.gen.UserAgreementMsg.SCHEMA$);
193       if (isValidValue(fields()[0], other.id)) {
194         this.id = (java.lang.String) data().deepCopy(fields()[0].schema(), other.id);
195         fieldSetFlags()[0] = true;
196       }
197       if (isValidValue(fields()[1], other.relatedIMEventOriginalID)) {
198         this.relatedIMEventOriginalID = (java.lang.String) data().deepCopy(fields()[1].schema(), other.relatedIMEventOriginalID);
199         fieldSetFlags()[1] = true;
200       }
201       if (isValidValue(fields()[2], other.userID)) {
202         this.userID = (java.lang.String) data().deepCopy(fields()[2].schema(), other.userID);
203         fieldSetFlags()[2] = true;
204       }
205       if (isValidValue(fields()[3], other.validFromMillis)) {
206         this.validFromMillis = (java.lang.Long) data().deepCopy(fields()[3].schema(), other.validFromMillis);
207         fieldSetFlags()[3] = true;
208       }
209       if (isValidValue(fields()[4], other.validToMillis)) {
210         this.validToMillis = (java.lang.Long) data().deepCopy(fields()[4].schema(), other.validToMillis);
211         fieldSetFlags()[4] = true;
212       }
213       if (isValidValue(fields()[5], other.role)) {
214         this.role = (java.lang.String) data().deepCopy(fields()[5].schema(), other.role);
215         fieldSetFlags()[5] = true;
216       }
217       if (isValidValue(fields()[6], other.fullPriceTableRef)) {
218         this.fullPriceTableRef = (gr.grnet.aquarium.message.avro.gen.FullPriceTableMsg) data().deepCopy(fields()[6].schema(), other.fullPriceTableRef);
219         fieldSetFlags()[6] = true;
220       }
221     }
222
223     /** Gets the value of the 'id' field */
224     public java.lang.String getId() {
225       return id;
226     }
227     
228     /** Sets the value of the 'id' field */
229     public gr.grnet.aquarium.message.avro.gen.UserAgreementMsg.Builder setId(java.lang.String 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.UserAgreementMsg.Builder clearId() {
243       id = null;
244       fieldSetFlags()[0] = false;
245       return this;
246     }
247
248     /** Gets the value of the 'relatedIMEventOriginalID' field */
249     public java.lang.String getRelatedIMEventOriginalID() {
250       return relatedIMEventOriginalID;
251     }
252     
253     /** Sets the value of the 'relatedIMEventOriginalID' field */
254     public gr.grnet.aquarium.message.avro.gen.UserAgreementMsg.Builder setRelatedIMEventOriginalID(java.lang.String value) {
255       validate(fields()[1], value);
256       this.relatedIMEventOriginalID = value;
257       fieldSetFlags()[1] = true;
258       return this; 
259     }
260     
261     /** Checks whether the 'relatedIMEventOriginalID' field has been set */
262     public boolean hasRelatedIMEventOriginalID() {
263       return fieldSetFlags()[1];
264     }
265     
266     /** Clears the value of the 'relatedIMEventOriginalID' field */
267     public gr.grnet.aquarium.message.avro.gen.UserAgreementMsg.Builder clearRelatedIMEventOriginalID() {
268       relatedIMEventOriginalID = null;
269       fieldSetFlags()[1] = false;
270       return this;
271     }
272
273     /** Gets the value of the 'userID' field */
274     public java.lang.String getUserID() {
275       return userID;
276     }
277     
278     /** Sets the value of the 'userID' field */
279     public gr.grnet.aquarium.message.avro.gen.UserAgreementMsg.Builder setUserID(java.lang.String value) {
280       validate(fields()[2], value);
281       this.userID = value;
282       fieldSetFlags()[2] = true;
283       return this; 
284     }
285     
286     /** Checks whether the 'userID' field has been set */
287     public boolean hasUserID() {
288       return fieldSetFlags()[2];
289     }
290     
291     /** Clears the value of the 'userID' field */
292     public gr.grnet.aquarium.message.avro.gen.UserAgreementMsg.Builder clearUserID() {
293       userID = null;
294       fieldSetFlags()[2] = false;
295       return this;
296     }
297
298     /** Gets the value of the 'validFromMillis' field */
299     public java.lang.Long getValidFromMillis() {
300       return validFromMillis;
301     }
302     
303     /** Sets the value of the 'validFromMillis' field */
304     public gr.grnet.aquarium.message.avro.gen.UserAgreementMsg.Builder setValidFromMillis(long value) {
305       validate(fields()[3], value);
306       this.validFromMillis = value;
307       fieldSetFlags()[3] = true;
308       return this; 
309     }
310     
311     /** Checks whether the 'validFromMillis' field has been set */
312     public boolean hasValidFromMillis() {
313       return fieldSetFlags()[3];
314     }
315     
316     /** Clears the value of the 'validFromMillis' field */
317     public gr.grnet.aquarium.message.avro.gen.UserAgreementMsg.Builder clearValidFromMillis() {
318       fieldSetFlags()[3] = false;
319       return this;
320     }
321
322     /** Gets the value of the 'validToMillis' field */
323     public java.lang.Long getValidToMillis() {
324       return validToMillis;
325     }
326     
327     /** Sets the value of the 'validToMillis' field */
328     public gr.grnet.aquarium.message.avro.gen.UserAgreementMsg.Builder setValidToMillis(long value) {
329       validate(fields()[4], value);
330       this.validToMillis = value;
331       fieldSetFlags()[4] = true;
332       return this; 
333     }
334     
335     /** Checks whether the 'validToMillis' field has been set */
336     public boolean hasValidToMillis() {
337       return fieldSetFlags()[4];
338     }
339     
340     /** Clears the value of the 'validToMillis' field */
341     public gr.grnet.aquarium.message.avro.gen.UserAgreementMsg.Builder clearValidToMillis() {
342       fieldSetFlags()[4] = false;
343       return this;
344     }
345
346     /** Gets the value of the 'role' field */
347     public java.lang.String getRole() {
348       return role;
349     }
350     
351     /** Sets the value of the 'role' field */
352     public gr.grnet.aquarium.message.avro.gen.UserAgreementMsg.Builder setRole(java.lang.String value) {
353       validate(fields()[5], value);
354       this.role = value;
355       fieldSetFlags()[5] = true;
356       return this; 
357     }
358     
359     /** Checks whether the 'role' field has been set */
360     public boolean hasRole() {
361       return fieldSetFlags()[5];
362     }
363     
364     /** Clears the value of the 'role' field */
365     public gr.grnet.aquarium.message.avro.gen.UserAgreementMsg.Builder clearRole() {
366       role = null;
367       fieldSetFlags()[5] = false;
368       return this;
369     }
370
371     /** Gets the value of the 'fullPriceTableRef' field */
372     public gr.grnet.aquarium.message.avro.gen.FullPriceTableMsg getFullPriceTableRef() {
373       return fullPriceTableRef;
374     }
375     
376     /** Sets the value of the 'fullPriceTableRef' field */
377     public gr.grnet.aquarium.message.avro.gen.UserAgreementMsg.Builder setFullPriceTableRef(gr.grnet.aquarium.message.avro.gen.FullPriceTableMsg value) {
378       validate(fields()[6], value);
379       this.fullPriceTableRef = value;
380       fieldSetFlags()[6] = true;
381       return this; 
382     }
383     
384     /** Checks whether the 'fullPriceTableRef' field has been set */
385     public boolean hasFullPriceTableRef() {
386       return fieldSetFlags()[6];
387     }
388     
389     /** Clears the value of the 'fullPriceTableRef' field */
390     public gr.grnet.aquarium.message.avro.gen.UserAgreementMsg.Builder clearFullPriceTableRef() {
391       fullPriceTableRef = null;
392       fieldSetFlags()[6] = false;
393       return this;
394     }
395
396     @Override
397     public UserAgreementMsg build() {
398       try {
399         UserAgreementMsg record = new UserAgreementMsg();
400         record.id = fieldSetFlags()[0] ? this.id : (java.lang.String) defaultValue(fields()[0]);
401         record.relatedIMEventOriginalID = fieldSetFlags()[1] ? this.relatedIMEventOriginalID : (java.lang.String) defaultValue(fields()[1]);
402         record.userID = fieldSetFlags()[2] ? this.userID : (java.lang.String) defaultValue(fields()[2]);
403         record.validFromMillis = fieldSetFlags()[3] ? this.validFromMillis : (java.lang.Long) defaultValue(fields()[3]);
404         record.validToMillis = fieldSetFlags()[4] ? this.validToMillis : (java.lang.Long) defaultValue(fields()[4]);
405         record.role = fieldSetFlags()[5] ? this.role : (java.lang.String) defaultValue(fields()[5]);
406         record.fullPriceTableRef = fieldSetFlags()[6] ? this.fullPriceTableRef : (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 }