Rename all messages
[aquarium] / src / main / java / gr / grnet / aquarium / message / avro / gen / EffectiveUnitPriceMsg.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 EffectiveUnitPriceMsg 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\":\"EffectiveUnitPriceMsg\",\"namespace\":\"gr.grnet.aquarium.message.avro.gen\",\"fields\":[{\"name\":\"unitPrice\",\"type\":\"double\"},{\"name\":\"when\",\"type\":[{\"type\":\"record\",\"name\":\"CronSpecTupleMsg\",\"fields\":[{\"name\":\"a\",\"type\":\"string\"},{\"name\":\"b\",\"type\":\"string\"}]},\"null\"]}]}");
10   @Deprecated public double unitPrice;
11   @Deprecated public gr.grnet.aquarium.message.avro.gen.CronSpecTupleMsg when;
12   public org.apache.avro.Schema getSchema() { return SCHEMA$; }
13   // Used by DatumWriter.  Applications should not call. 
14   public java.lang.Object get(int field$) {
15     switch (field$) {
16     case 0: return unitPrice;
17     case 1: return when;
18     default: throw new org.apache.avro.AvroRuntimeException("Bad index");
19     }
20   }
21   // Used by DatumReader.  Applications should not call. 
22   @SuppressWarnings(value="unchecked")
23   public void put(int field$, java.lang.Object value$) {
24     switch (field$) {
25     case 0: unitPrice = (java.lang.Double)value$; break;
26     case 1: when = (gr.grnet.aquarium.message.avro.gen.CronSpecTupleMsg)value$; break;
27     default: throw new org.apache.avro.AvroRuntimeException("Bad index");
28     }
29   }
30
31   /**
32    * Gets the value of the 'unitPrice' field.
33    */
34   public java.lang.Double getUnitPrice() {
35     return unitPrice;
36   }
37
38   /**
39    * Sets the value of the 'unitPrice' field.
40    * @param value the value to set.
41    */
42   public void setUnitPrice(java.lang.Double value) {
43     this.unitPrice = value;
44   }
45
46   /**
47    * Gets the value of the 'when' field.
48    */
49   public gr.grnet.aquarium.message.avro.gen.CronSpecTupleMsg getWhen() {
50     return when;
51   }
52
53   /**
54    * Sets the value of the 'when' field.
55    * @param value the value to set.
56    */
57   public void setWhen(gr.grnet.aquarium.message.avro.gen.CronSpecTupleMsg value) {
58     this.when = value;
59   }
60
61   /** Creates a new EffectiveUnitPriceMsg RecordBuilder */
62   public static gr.grnet.aquarium.message.avro.gen.EffectiveUnitPriceMsg.Builder newBuilder() {
63     return new gr.grnet.aquarium.message.avro.gen.EffectiveUnitPriceMsg.Builder();
64   }
65   
66   /** Creates a new EffectiveUnitPriceMsg RecordBuilder by copying an existing Builder */
67   public static gr.grnet.aquarium.message.avro.gen.EffectiveUnitPriceMsg.Builder newBuilder(gr.grnet.aquarium.message.avro.gen.EffectiveUnitPriceMsg.Builder other) {
68     return new gr.grnet.aquarium.message.avro.gen.EffectiveUnitPriceMsg.Builder(other);
69   }
70   
71   /** Creates a new EffectiveUnitPriceMsg RecordBuilder by copying an existing EffectiveUnitPriceMsg instance */
72   public static gr.grnet.aquarium.message.avro.gen.EffectiveUnitPriceMsg.Builder newBuilder(gr.grnet.aquarium.message.avro.gen.EffectiveUnitPriceMsg other) {
73     return new gr.grnet.aquarium.message.avro.gen.EffectiveUnitPriceMsg.Builder(other);
74   }
75   
76   /**
77    * RecordBuilder for EffectiveUnitPriceMsg instances.
78    */
79   public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<EffectiveUnitPriceMsg>
80     implements org.apache.avro.data.RecordBuilder<EffectiveUnitPriceMsg> {
81
82     private double unitPrice;
83     private gr.grnet.aquarium.message.avro.gen.CronSpecTupleMsg when;
84
85     /** Creates a new Builder */
86     private Builder() {
87       super(gr.grnet.aquarium.message.avro.gen.EffectiveUnitPriceMsg.SCHEMA$);
88     }
89     
90     /** Creates a Builder by copying an existing Builder */
91     private Builder(gr.grnet.aquarium.message.avro.gen.EffectiveUnitPriceMsg.Builder other) {
92       super(other);
93     }
94     
95     /** Creates a Builder by copying an existing EffectiveUnitPriceMsg instance */
96     private Builder(gr.grnet.aquarium.message.avro.gen.EffectiveUnitPriceMsg other) {
97             super(gr.grnet.aquarium.message.avro.gen.EffectiveUnitPriceMsg.SCHEMA$);
98       if (isValidValue(fields()[0], other.unitPrice)) {
99         this.unitPrice = (java.lang.Double) data().deepCopy(fields()[0].schema(), other.unitPrice);
100         fieldSetFlags()[0] = true;
101       }
102       if (isValidValue(fields()[1], other.when)) {
103         this.when = (gr.grnet.aquarium.message.avro.gen.CronSpecTupleMsg) data().deepCopy(fields()[1].schema(), other.when);
104         fieldSetFlags()[1] = true;
105       }
106     }
107
108     /** Gets the value of the 'unitPrice' field */
109     public java.lang.Double getUnitPrice() {
110       return unitPrice;
111     }
112     
113     /** Sets the value of the 'unitPrice' field */
114     public gr.grnet.aquarium.message.avro.gen.EffectiveUnitPriceMsg.Builder setUnitPrice(double value) {
115       validate(fields()[0], value);
116       this.unitPrice = value;
117       fieldSetFlags()[0] = true;
118       return this; 
119     }
120     
121     /** Checks whether the 'unitPrice' field has been set */
122     public boolean hasUnitPrice() {
123       return fieldSetFlags()[0];
124     }
125     
126     /** Clears the value of the 'unitPrice' field */
127     public gr.grnet.aquarium.message.avro.gen.EffectiveUnitPriceMsg.Builder clearUnitPrice() {
128       fieldSetFlags()[0] = false;
129       return this;
130     }
131
132     /** Gets the value of the 'when' field */
133     public gr.grnet.aquarium.message.avro.gen.CronSpecTupleMsg getWhen() {
134       return when;
135     }
136     
137     /** Sets the value of the 'when' field */
138     public gr.grnet.aquarium.message.avro.gen.EffectiveUnitPriceMsg.Builder setWhen(gr.grnet.aquarium.message.avro.gen.CronSpecTupleMsg value) {
139       validate(fields()[1], value);
140       this.when = value;
141       fieldSetFlags()[1] = true;
142       return this; 
143     }
144     
145     /** Checks whether the 'when' field has been set */
146     public boolean hasWhen() {
147       return fieldSetFlags()[1];
148     }
149     
150     /** Clears the value of the 'when' field */
151     public gr.grnet.aquarium.message.avro.gen.EffectiveUnitPriceMsg.Builder clearWhen() {
152       when = null;
153       fieldSetFlags()[1] = false;
154       return this;
155     }
156
157     @Override
158     public EffectiveUnitPriceMsg build() {
159       try {
160         EffectiveUnitPriceMsg record = new EffectiveUnitPriceMsg();
161         record.unitPrice = fieldSetFlags()[0] ? this.unitPrice : (java.lang.Double) defaultValue(fields()[0]);
162         record.when = fieldSetFlags()[1] ? this.when : (gr.grnet.aquarium.message.avro.gen.CronSpecTupleMsg) defaultValue(fields()[1]);
163         return record;
164       } catch (Exception e) {
165         throw new org.apache.avro.AvroRuntimeException(e);
166       }
167     }
168   }
169 }