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\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"b\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}}]},\"null\"]}]}");
10 @Deprecated public double unitPrice;
11 @Deprecated public gr.grnet.aquarium.message.avro.gen.CronSpecTupleMsg when;
14 * Default constructor.
16 public EffectiveUnitPriceMsg() {}
19 * All-args constructor.
21 public EffectiveUnitPriceMsg(java.lang.Double unitPrice, gr.grnet.aquarium.message.avro.gen.CronSpecTupleMsg when) {
22 this.unitPrice = unitPrice;
26 public org.apache.avro.Schema getSchema() { return SCHEMA$; }
27 // Used by DatumWriter. Applications should not call.
28 public java.lang.Object get(int field$) {
30 case 0: return unitPrice;
32 default: throw new org.apache.avro.AvroRuntimeException("Bad index");
35 // Used by DatumReader. Applications should not call.
36 @SuppressWarnings(value="unchecked")
37 public void put(int field$, java.lang.Object value$) {
39 case 0: unitPrice = (java.lang.Double)value$; break;
40 case 1: when = (gr.grnet.aquarium.message.avro.gen.CronSpecTupleMsg)value$; break;
41 default: throw new org.apache.avro.AvroRuntimeException("Bad index");
46 * Gets the value of the 'unitPrice' field.
48 public java.lang.Double getUnitPrice() {
53 * Sets the value of the 'unitPrice' field.
54 * @param value the value to set.
56 public void setUnitPrice(java.lang.Double value) {
57 this.unitPrice = value;
61 * Gets the value of the 'when' field.
63 public gr.grnet.aquarium.message.avro.gen.CronSpecTupleMsg getWhen() {
68 * Sets the value of the 'when' field.
69 * @param value the value to set.
71 public void setWhen(gr.grnet.aquarium.message.avro.gen.CronSpecTupleMsg value) {
75 /** Creates a new EffectiveUnitPriceMsg RecordBuilder */
76 public static gr.grnet.aquarium.message.avro.gen.EffectiveUnitPriceMsg.Builder newBuilder() {
77 return new gr.grnet.aquarium.message.avro.gen.EffectiveUnitPriceMsg.Builder();
80 /** Creates a new EffectiveUnitPriceMsg RecordBuilder by copying an existing Builder */
81 public static gr.grnet.aquarium.message.avro.gen.EffectiveUnitPriceMsg.Builder newBuilder(gr.grnet.aquarium.message.avro.gen.EffectiveUnitPriceMsg.Builder other) {
82 return new gr.grnet.aquarium.message.avro.gen.EffectiveUnitPriceMsg.Builder(other);
85 /** Creates a new EffectiveUnitPriceMsg RecordBuilder by copying an existing EffectiveUnitPriceMsg instance */
86 public static gr.grnet.aquarium.message.avro.gen.EffectiveUnitPriceMsg.Builder newBuilder(gr.grnet.aquarium.message.avro.gen.EffectiveUnitPriceMsg other) {
87 return new gr.grnet.aquarium.message.avro.gen.EffectiveUnitPriceMsg.Builder(other);
91 * RecordBuilder for EffectiveUnitPriceMsg instances.
93 public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<EffectiveUnitPriceMsg>
94 implements org.apache.avro.data.RecordBuilder<EffectiveUnitPriceMsg> {
96 private double unitPrice;
97 private gr.grnet.aquarium.message.avro.gen.CronSpecTupleMsg when;
99 /** Creates a new Builder */
101 super(gr.grnet.aquarium.message.avro.gen.EffectiveUnitPriceMsg.SCHEMA$);
104 /** Creates a Builder by copying an existing Builder */
105 private Builder(gr.grnet.aquarium.message.avro.gen.EffectiveUnitPriceMsg.Builder other) {
109 /** Creates a Builder by copying an existing EffectiveUnitPriceMsg instance */
110 private Builder(gr.grnet.aquarium.message.avro.gen.EffectiveUnitPriceMsg other) {
111 super(gr.grnet.aquarium.message.avro.gen.EffectiveUnitPriceMsg.SCHEMA$);
112 if (isValidValue(fields()[0], other.unitPrice)) {
113 this.unitPrice = (java.lang.Double) data().deepCopy(fields()[0].schema(), other.unitPrice);
114 fieldSetFlags()[0] = true;
116 if (isValidValue(fields()[1], other.when)) {
117 this.when = (gr.grnet.aquarium.message.avro.gen.CronSpecTupleMsg) data().deepCopy(fields()[1].schema(), other.when);
118 fieldSetFlags()[1] = true;
122 /** Gets the value of the 'unitPrice' field */
123 public java.lang.Double getUnitPrice() {
127 /** Sets the value of the 'unitPrice' field */
128 public gr.grnet.aquarium.message.avro.gen.EffectiveUnitPriceMsg.Builder setUnitPrice(double value) {
129 validate(fields()[0], value);
130 this.unitPrice = value;
131 fieldSetFlags()[0] = true;
135 /** Checks whether the 'unitPrice' field has been set */
136 public boolean hasUnitPrice() {
137 return fieldSetFlags()[0];
140 /** Clears the value of the 'unitPrice' field */
141 public gr.grnet.aquarium.message.avro.gen.EffectiveUnitPriceMsg.Builder clearUnitPrice() {
142 fieldSetFlags()[0] = false;
146 /** Gets the value of the 'when' field */
147 public gr.grnet.aquarium.message.avro.gen.CronSpecTupleMsg getWhen() {
151 /** Sets the value of the 'when' field */
152 public gr.grnet.aquarium.message.avro.gen.EffectiveUnitPriceMsg.Builder setWhen(gr.grnet.aquarium.message.avro.gen.CronSpecTupleMsg value) {
153 validate(fields()[1], value);
155 fieldSetFlags()[1] = true;
159 /** Checks whether the 'when' field has been set */
160 public boolean hasWhen() {
161 return fieldSetFlags()[1];
164 /** Clears the value of the 'when' field */
165 public gr.grnet.aquarium.message.avro.gen.EffectiveUnitPriceMsg.Builder clearWhen() {
167 fieldSetFlags()[1] = false;
172 public EffectiveUnitPriceMsg build() {
174 EffectiveUnitPriceMsg record = new EffectiveUnitPriceMsg();
175 record.unitPrice = fieldSetFlags()[0] ? this.unitPrice : (java.lang.Double) defaultValue(fields()[0]);
176 record.when = fieldSetFlags()[1] ? this.when : (gr.grnet.aquarium.message.avro.gen.CronSpecTupleMsg) defaultValue(fields()[1]);
178 } catch (Exception e) {
179 throw new org.apache.avro.AvroRuntimeException(e);