2 * Autogenerated by Avro
6 package gr.grnet.aquarium.message.avro.gen;
7 @SuppressWarnings("all")
8 public class _AnyValue 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\":\"_AnyValue\",\"namespace\":\"gr.grnet.aquarium.message.avro.gen\",\"fields\":[{\"name\":\"anyValue\",\"type\":[\"null\",\"int\",\"long\",\"boolean\",\"double\",\"bytes\",\"string\"]}]}");
10 @Deprecated public java.lang.Object anyValue;
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$) {
15 case 0: return anyValue;
16 default: throw new org.apache.avro.AvroRuntimeException("Bad index");
19 // Used by DatumReader. Applications should not call.
20 @SuppressWarnings(value="unchecked")
21 public void put(int field$, java.lang.Object value$) {
23 case 0: anyValue = (java.lang.Object)value$; break;
24 default: throw new org.apache.avro.AvroRuntimeException("Bad index");
29 * Gets the value of the 'anyValue' field.
31 public java.lang.Object getAnyValue() {
36 * Sets the value of the 'anyValue' field.
37 * @param value the value to set.
39 public void setAnyValue(java.lang.Object value) {
40 this.anyValue = value;
43 /** Creates a new _AnyValue RecordBuilder */
44 public static gr.grnet.aquarium.message.avro.gen._AnyValue.Builder newBuilder() {
45 return new gr.grnet.aquarium.message.avro.gen._AnyValue.Builder();
48 /** Creates a new _AnyValue RecordBuilder by copying an existing Builder */
49 public static gr.grnet.aquarium.message.avro.gen._AnyValue.Builder newBuilder(gr.grnet.aquarium.message.avro.gen._AnyValue.Builder other) {
50 return new gr.grnet.aquarium.message.avro.gen._AnyValue.Builder(other);
53 /** Creates a new _AnyValue RecordBuilder by copying an existing _AnyValue instance */
54 public static gr.grnet.aquarium.message.avro.gen._AnyValue.Builder newBuilder(gr.grnet.aquarium.message.avro.gen._AnyValue other) {
55 return new gr.grnet.aquarium.message.avro.gen._AnyValue.Builder(other);
59 * RecordBuilder for _AnyValue instances.
61 public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<_AnyValue>
62 implements org.apache.avro.data.RecordBuilder<_AnyValue> {
64 private java.lang.Object anyValue;
66 /** Creates a new Builder */
68 super(gr.grnet.aquarium.message.avro.gen._AnyValue.SCHEMA$);
71 /** Creates a Builder by copying an existing Builder */
72 private Builder(gr.grnet.aquarium.message.avro.gen._AnyValue.Builder other) {
76 /** Creates a Builder by copying an existing _AnyValue instance */
77 private Builder(gr.grnet.aquarium.message.avro.gen._AnyValue other) {
78 super(gr.grnet.aquarium.message.avro.gen._AnyValue.SCHEMA$);
79 if (isValidValue(fields()[0], other.anyValue)) {
80 this.anyValue = (java.lang.Object) data().deepCopy(fields()[0].schema(), other.anyValue);
81 fieldSetFlags()[0] = true;
85 /** Gets the value of the 'anyValue' field */
86 public java.lang.Object getAnyValue() {
90 /** Sets the value of the 'anyValue' field */
91 public gr.grnet.aquarium.message.avro.gen._AnyValue.Builder setAnyValue(java.lang.Object value) {
92 validate(fields()[0], value);
93 this.anyValue = value;
94 fieldSetFlags()[0] = true;
98 /** Checks whether the 'anyValue' field has been set */
99 public boolean hasAnyValue() {
100 return fieldSetFlags()[0];
103 /** Clears the value of the 'anyValue' field */
104 public gr.grnet.aquarium.message.avro.gen._AnyValue.Builder clearAnyValue() {
106 fieldSetFlags()[0] = false;
111 public _AnyValue build() {
113 _AnyValue record = new _AnyValue();
114 record.anyValue = fieldSetFlags()[0] ? this.anyValue : (java.lang.Object) defaultValue(fields()[0]);
116 } catch (Exception e) {
117 throw new org.apache.avro.AvroRuntimeException(e);