2 * Autogenerated by Avro
6 package gr.grnet.aquarium.message.avro.gen;
7 @SuppressWarnings("all")
8 public class AnyValueMsg 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\":\"AnyValueMsg\",\"namespace\":\"gr.grnet.aquarium.message.avro.gen\",\"fields\":[{\"name\":\"anyValue\",\"type\":[\"null\",\"int\",\"long\",\"boolean\",\"double\",\"bytes\",{\"type\":\"string\",\"avro.java.string\":\"String\"},{\"type\":\"array\",\"items\":\"AnyValueMsg\"},{\"type\":\"map\",\"values\":\"AnyValueMsg\",\"avro.java.string\":\"String\"}]}]}");
10 @Deprecated public java.lang.Object anyValue;
13 * Default constructor.
15 public AnyValueMsg() {}
18 * All-args constructor.
20 public AnyValueMsg(java.lang.Object anyValue) {
21 this.anyValue = anyValue;
24 public org.apache.avro.Schema getSchema() { return SCHEMA$; }
25 // Used by DatumWriter. Applications should not call.
26 public java.lang.Object get(int field$) {
28 case 0: return anyValue;
29 default: throw new org.apache.avro.AvroRuntimeException("Bad index");
32 // Used by DatumReader. Applications should not call.
33 @SuppressWarnings(value="unchecked")
34 public void put(int field$, java.lang.Object value$) {
36 case 0: anyValue = (java.lang.Object)value$; break;
37 default: throw new org.apache.avro.AvroRuntimeException("Bad index");
42 * Gets the value of the 'anyValue' field.
44 public java.lang.Object getAnyValue() {
49 * Sets the value of the 'anyValue' field.
50 * @param value the value to set.
52 public void setAnyValue(java.lang.Object value) {
53 this.anyValue = value;
56 /** Creates a new AnyValueMsg RecordBuilder */
57 public static gr.grnet.aquarium.message.avro.gen.AnyValueMsg.Builder newBuilder() {
58 return new gr.grnet.aquarium.message.avro.gen.AnyValueMsg.Builder();
61 /** Creates a new AnyValueMsg RecordBuilder by copying an existing Builder */
62 public static gr.grnet.aquarium.message.avro.gen.AnyValueMsg.Builder newBuilder(gr.grnet.aquarium.message.avro.gen.AnyValueMsg.Builder other) {
63 return new gr.grnet.aquarium.message.avro.gen.AnyValueMsg.Builder(other);
66 /** Creates a new AnyValueMsg RecordBuilder by copying an existing AnyValueMsg instance */
67 public static gr.grnet.aquarium.message.avro.gen.AnyValueMsg.Builder newBuilder(gr.grnet.aquarium.message.avro.gen.AnyValueMsg other) {
68 return new gr.grnet.aquarium.message.avro.gen.AnyValueMsg.Builder(other);
72 * RecordBuilder for AnyValueMsg instances.
74 public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<AnyValueMsg>
75 implements org.apache.avro.data.RecordBuilder<AnyValueMsg> {
77 private java.lang.Object anyValue;
79 /** Creates a new Builder */
81 super(gr.grnet.aquarium.message.avro.gen.AnyValueMsg.SCHEMA$);
84 /** Creates a Builder by copying an existing Builder */
85 private Builder(gr.grnet.aquarium.message.avro.gen.AnyValueMsg.Builder other) {
89 /** Creates a Builder by copying an existing AnyValueMsg instance */
90 private Builder(gr.grnet.aquarium.message.avro.gen.AnyValueMsg other) {
91 super(gr.grnet.aquarium.message.avro.gen.AnyValueMsg.SCHEMA$);
92 if (isValidValue(fields()[0], other.anyValue)) {
93 this.anyValue = (java.lang.Object) data().deepCopy(fields()[0].schema(), other.anyValue);
94 fieldSetFlags()[0] = true;
98 /** Gets the value of the 'anyValue' field */
99 public java.lang.Object getAnyValue() {
103 /** Sets the value of the 'anyValue' field */
104 public gr.grnet.aquarium.message.avro.gen.AnyValueMsg.Builder setAnyValue(java.lang.Object value) {
105 validate(fields()[0], value);
106 this.anyValue = value;
107 fieldSetFlags()[0] = true;
111 /** Checks whether the 'anyValue' field has been set */
112 public boolean hasAnyValue() {
113 return fieldSetFlags()[0];
116 /** Clears the value of the 'anyValue' field */
117 public gr.grnet.aquarium.message.avro.gen.AnyValueMsg.Builder clearAnyValue() {
119 fieldSetFlags()[0] = false;
124 public AnyValueMsg build() {
126 AnyValueMsg record = new AnyValueMsg();
127 record.anyValue = fieldSetFlags()[0] ? this.anyValue : (java.lang.Object) defaultValue(fields()[0]);
129 } catch (Exception e) {
130 throw new org.apache.avro.AvroRuntimeException(e);