/** * Autogenerated by Avro * * DO NOT EDIT DIRECTLY */ package org.wikipedia.miner.extract.model.struct; @SuppressWarnings("all") @org.apache.avro.specific.AvroGenerated public class PrimaryLabels extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord { public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"PrimaryLabels\",\"namespace\":\"org.wikipedia.miner.extract.model.struct\",\"fields\":[{\"name\":\"labels\",\"type\":{\"type\":\"array\",\"items\":\"string\"}}]}"); public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; } @Deprecated public java.util.List<java.lang.CharSequence> labels; /** * Default constructor. Note that this does not initialize fields * to their default values from the schema. If that is desired then * one should use {@link \#newBuilder()}. */ public PrimaryLabels() {} /** * All-args constructor. */ public PrimaryLabels(java.util.List<java.lang.CharSequence> labels) { this.labels = labels; } public org.apache.avro.Schema getSchema() { return SCHEMA$; } // Used by DatumWriter. Applications should not call. public java.lang.Object get(int field$) { switch (field$) { case 0: return labels; default: throw new org.apache.avro.AvroRuntimeException("Bad index"); } } // Used by DatumReader. Applications should not call. @SuppressWarnings(value="unchecked") public void put(int field$, java.lang.Object value$) { switch (field$) { case 0: labels = (java.util.List<java.lang.CharSequence>)value$; break; default: throw new org.apache.avro.AvroRuntimeException("Bad index"); } } /** * Gets the value of the 'labels' field. */ public java.util.List<java.lang.CharSequence> getLabels() { return labels; } /** * Sets the value of the 'labels' field. * @param value the value to set. */ public void setLabels(java.util.List<java.lang.CharSequence> value) { this.labels = value; } /** Creates a new PrimaryLabels RecordBuilder */ public static org.wikipedia.miner.extract.model.struct.PrimaryLabels.Builder newBuilder() { return new org.wikipedia.miner.extract.model.struct.PrimaryLabels.Builder(); } /** Creates a new PrimaryLabels RecordBuilder by copying an existing Builder */ public static org.wikipedia.miner.extract.model.struct.PrimaryLabels.Builder newBuilder(org.wikipedia.miner.extract.model.struct.PrimaryLabels.Builder other) { return new org.wikipedia.miner.extract.model.struct.PrimaryLabels.Builder(other); } /** Creates a new PrimaryLabels RecordBuilder by copying an existing PrimaryLabels instance */ public static org.wikipedia.miner.extract.model.struct.PrimaryLabels.Builder newBuilder(org.wikipedia.miner.extract.model.struct.PrimaryLabels other) { return new org.wikipedia.miner.extract.model.struct.PrimaryLabels.Builder(other); } /** * RecordBuilder for PrimaryLabels instances. */ public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<PrimaryLabels> implements org.apache.avro.data.RecordBuilder<PrimaryLabels> { private java.util.List<java.lang.CharSequence> labels; /** Creates a new Builder */ private Builder() { super(org.wikipedia.miner.extract.model.struct.PrimaryLabels.SCHEMA$); } /** Creates a Builder by copying an existing Builder */ private Builder(org.wikipedia.miner.extract.model.struct.PrimaryLabels.Builder other) { super(other); if (isValidValue(fields()[0], other.labels)) { this.labels = data().deepCopy(fields()[0].schema(), other.labels); fieldSetFlags()[0] = true; } } /** Creates a Builder by copying an existing PrimaryLabels instance */ private Builder(org.wikipedia.miner.extract.model.struct.PrimaryLabels other) { super(org.wikipedia.miner.extract.model.struct.PrimaryLabels.SCHEMA$); if (isValidValue(fields()[0], other.labels)) { this.labels = data().deepCopy(fields()[0].schema(), other.labels); fieldSetFlags()[0] = true; } } /** Gets the value of the 'labels' field */ public java.util.List<java.lang.CharSequence> getLabels() { return labels; } /** Sets the value of the 'labels' field */ public org.wikipedia.miner.extract.model.struct.PrimaryLabels.Builder setLabels(java.util.List<java.lang.CharSequence> value) { validate(fields()[0], value); this.labels = value; fieldSetFlags()[0] = true; return this; } /** Checks whether the 'labels' field has been set */ public boolean hasLabels() { return fieldSetFlags()[0]; } /** Clears the value of the 'labels' field */ public org.wikipedia.miner.extract.model.struct.PrimaryLabels.Builder clearLabels() { labels = null; fieldSetFlags()[0] = false; return this; } @Override public PrimaryLabels build() { try { PrimaryLabels record = new PrimaryLabels(); record.labels = fieldSetFlags()[0] ? this.labels : (java.util.List<java.lang.CharSequence>) defaultValue(fields()[0]); return record; } catch (Exception e) { throw new org.apache.avro.AvroRuntimeException(e); } } } }