fe8b7244a2a7563242c84033fc0e0d8559ea18be
[aquarium] / src / main / java / gr / grnet / aquarium / message / avro / gen / WorkingAgreementHistoryMsg.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 WorkingAgreementHistoryMsg 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\":\"WorkingAgreementHistoryMsg\",\"namespace\":\"gr.grnet.aquarium.message.avro.gen\",\"fields\":[{\"name\":\"agreements\",\"type\":{\"type\":\"array\",\"items\":{\"type\":\"record\",\"name\":\"UserAgreementMsg\",\"fields\":[{\"name\":\"id\",\"type\":\"string\"},{\"name\":\"relatedIMEventID\",\"type\":[\"string\",\"null\"]},{\"name\":\"validFromMillis\",\"type\":\"long\"},{\"name\":\"validToMillis\",\"type\":\"long\"},{\"name\":\"role\",\"type\":\"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\":\"string\"},{\"name\":\"b\",\"type\":\"string\"}]},\"null\"]}]}}}]},{\"type\":\"map\",\"values\":\"SelectorValueMsg\"}]}]}}}}]},\"null\"]}]}}}]}");
10   @Deprecated public java.util.List<gr.grnet.aquarium.message.avro.gen.UserAgreementMsg> agreements;
11   public org.apache.avro.Schema getSchema() { return SCHEMA$; }
12   // Used by DatumWriter.  Applications should not call. 
13   public java.lang.Object get(int field$) {
14     switch (field$) {
15     case 0: return agreements;
16     default: throw new org.apache.avro.AvroRuntimeException("Bad index");
17     }
18   }
19   // Used by DatumReader.  Applications should not call. 
20   @SuppressWarnings(value="unchecked")
21   public void put(int field$, java.lang.Object value$) {
22     switch (field$) {
23     case 0: agreements = (java.util.List<gr.grnet.aquarium.message.avro.gen.UserAgreementMsg>)value$; break;
24     default: throw new org.apache.avro.AvroRuntimeException("Bad index");
25     }
26   }
27
28   /**
29    * Gets the value of the 'agreements' field.
30    */
31   public java.util.List<gr.grnet.aquarium.message.avro.gen.UserAgreementMsg> getAgreements() {
32     return agreements;
33   }
34
35   /**
36    * Sets the value of the 'agreements' field.
37    * @param value the value to set.
38    */
39   public void setAgreements(java.util.List<gr.grnet.aquarium.message.avro.gen.UserAgreementMsg> value) {
40     this.agreements = value;
41   }
42
43   /** Creates a new WorkingAgreementHistoryMsg RecordBuilder */
44   public static gr.grnet.aquarium.message.avro.gen.WorkingAgreementHistoryMsg.Builder newBuilder() {
45     return new gr.grnet.aquarium.message.avro.gen.WorkingAgreementHistoryMsg.Builder();
46   }
47   
48   /** Creates a new WorkingAgreementHistoryMsg RecordBuilder by copying an existing Builder */
49   public static gr.grnet.aquarium.message.avro.gen.WorkingAgreementHistoryMsg.Builder newBuilder(gr.grnet.aquarium.message.avro.gen.WorkingAgreementHistoryMsg.Builder other) {
50     return new gr.grnet.aquarium.message.avro.gen.WorkingAgreementHistoryMsg.Builder(other);
51   }
52   
53   /** Creates a new WorkingAgreementHistoryMsg RecordBuilder by copying an existing WorkingAgreementHistoryMsg instance */
54   public static gr.grnet.aquarium.message.avro.gen.WorkingAgreementHistoryMsg.Builder newBuilder(gr.grnet.aquarium.message.avro.gen.WorkingAgreementHistoryMsg other) {
55     return new gr.grnet.aquarium.message.avro.gen.WorkingAgreementHistoryMsg.Builder(other);
56   }
57   
58   /**
59    * RecordBuilder for WorkingAgreementHistoryMsg instances.
60    */
61   public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<WorkingAgreementHistoryMsg>
62     implements org.apache.avro.data.RecordBuilder<WorkingAgreementHistoryMsg> {
63
64     private java.util.List<gr.grnet.aquarium.message.avro.gen.UserAgreementMsg> agreements;
65
66     /** Creates a new Builder */
67     private Builder() {
68       super(gr.grnet.aquarium.message.avro.gen.WorkingAgreementHistoryMsg.SCHEMA$);
69     }
70     
71     /** Creates a Builder by copying an existing Builder */
72     private Builder(gr.grnet.aquarium.message.avro.gen.WorkingAgreementHistoryMsg.Builder other) {
73       super(other);
74     }
75     
76     /** Creates a Builder by copying an existing WorkingAgreementHistoryMsg instance */
77     private Builder(gr.grnet.aquarium.message.avro.gen.WorkingAgreementHistoryMsg other) {
78             super(gr.grnet.aquarium.message.avro.gen.WorkingAgreementHistoryMsg.SCHEMA$);
79       if (isValidValue(fields()[0], other.agreements)) {
80         this.agreements = (java.util.List<gr.grnet.aquarium.message.avro.gen.UserAgreementMsg>) data().deepCopy(fields()[0].schema(), other.agreements);
81         fieldSetFlags()[0] = true;
82       }
83     }
84
85     /** Gets the value of the 'agreements' field */
86     public java.util.List<gr.grnet.aquarium.message.avro.gen.UserAgreementMsg> getAgreements() {
87       return agreements;
88     }
89     
90     /** Sets the value of the 'agreements' field */
91     public gr.grnet.aquarium.message.avro.gen.WorkingAgreementHistoryMsg.Builder setAgreements(java.util.List<gr.grnet.aquarium.message.avro.gen.UserAgreementMsg> value) {
92       validate(fields()[0], value);
93       this.agreements = value;
94       fieldSetFlags()[0] = true;
95       return this; 
96     }
97     
98     /** Checks whether the 'agreements' field has been set */
99     public boolean hasAgreements() {
100       return fieldSetFlags()[0];
101     }
102     
103     /** Clears the value of the 'agreements' field */
104     public gr.grnet.aquarium.message.avro.gen.WorkingAgreementHistoryMsg.Builder clearAgreements() {
105       agreements = null;
106       fieldSetFlags()[0] = false;
107       return this;
108     }
109
110     @Override
111     public WorkingAgreementHistoryMsg build() {
112       try {
113         WorkingAgreementHistoryMsg record = new WorkingAgreementHistoryMsg();
114         record.agreements = fieldSetFlags()[0] ? this.agreements : (java.util.List<gr.grnet.aquarium.message.avro.gen.UserAgreementMsg>) defaultValue(fields()[0]);
115         return record;
116       } catch (Exception e) {
117         throw new org.apache.avro.AvroRuntimeException(e);
118       }
119     }
120   }
121 }