2 * Autogenerated by Avro
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$) {
16 case 0: return unitPrice;
18 default: throw new org.apache.avro.AvroRuntimeException("Bad index");
21 // Used by DatumReader. Applications should not call.
22 @SuppressWarnings(value="unchecked")
23 public void put(int field$, java.lang.Object value$) {
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");
32 * Gets the value of the 'unitPrice' field.
34 public java.lang.Double getUnitPrice() {
39 * Sets the value of the 'unitPrice' field.
40 * @param value the value to set.
42 public void setUnitPrice(java.lang.Double value) {
43 this.unitPrice = value;
47 * Gets the value of the 'when' field.
49 public gr.grnet.aquarium.message.avro.gen.CronSpecTupleMsg getWhen() {
54 * Sets the value of the 'when' field.
55 * @param value the value to set.
57 public void setWhen(gr.grnet.aquarium.message.avro.gen.CronSpecTupleMsg value) {
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();
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);
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);
77 * RecordBuilder for EffectiveUnitPriceMsg instances.
79 public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<EffectiveUnitPriceMsg>
80 implements org.apache.avro.data.RecordBuilder<EffectiveUnitPriceMsg> {
82 private double unitPrice;
83 private gr.grnet.aquarium.message.avro.gen.CronSpecTupleMsg when;
85 /** Creates a new Builder */
87 super(gr.grnet.aquarium.message.avro.gen.EffectiveUnitPriceMsg.SCHEMA$);
90 /** Creates a Builder by copying an existing Builder */
91 private Builder(gr.grnet.aquarium.message.avro.gen.EffectiveUnitPriceMsg.Builder other) {
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;
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;
108 /** Gets the value of the 'unitPrice' field */
109 public java.lang.Double getUnitPrice() {
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;
121 /** Checks whether the 'unitPrice' field has been set */
122 public boolean hasUnitPrice() {
123 return fieldSetFlags()[0];
126 /** Clears the value of the 'unitPrice' field */
127 public gr.grnet.aquarium.message.avro.gen.EffectiveUnitPriceMsg.Builder clearUnitPrice() {
128 fieldSetFlags()[0] = false;
132 /** Gets the value of the 'when' field */
133 public gr.grnet.aquarium.message.avro.gen.CronSpecTupleMsg getWhen() {
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);
141 fieldSetFlags()[1] = true;
145 /** Checks whether the 'when' field has been set */
146 public boolean hasWhen() {
147 return fieldSetFlags()[1];
150 /** Clears the value of the 'when' field */
151 public gr.grnet.aquarium.message.avro.gen.EffectiveUnitPriceMsg.Builder clearWhen() {
153 fieldSetFlags()[1] = false;
158 public EffectiveUnitPriceMsg build() {
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]);
164 } catch (Exception e) {
165 throw new org.apache.avro.AvroRuntimeException(e);