/** * Autogenerated by Avro * * DO NOT EDIT DIRECTLY */ package org.wikipedia.miner.extract.model.struct; @SuppressWarnings("all") @org.apache.avro.specific.AvroGenerated public class LinkSummary 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\":\"LinkSummary\",\"namespace\":\"org.wikipedia.miner.extract.model.struct\",\"fields\":[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"title\",\"type\":\"string\"},{\"name\":\"namespace\",\"type\":\"int\"},{\"name\":\"forwarded\",\"type\":\"boolean\"},{\"name\":\"sentenceIndexes\",\"type\":{\"type\":\"array\",\"items\":\"int\"}}]}"); public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; } @Deprecated public int id; @Deprecated public java.lang.CharSequence title; @Deprecated public int namespace; @Deprecated public boolean forwarded; @Deprecated public java.util.List<java.lang.Integer> sentenceIndexes; /** * 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 LinkSummary() {} /** * All-args constructor. */ public LinkSummary(java.lang.Integer id, java.lang.CharSequence title, java.lang.Integer namespace, java.lang.Boolean forwarded, java.util.List<java.lang.Integer> sentenceIndexes) { this.id = id; this.title = title; this.namespace = namespace; this.forwarded = forwarded; this.sentenceIndexes = sentenceIndexes; } 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 id; case 1: return title; case 2: return namespace; case 3: return forwarded; case 4: return sentenceIndexes; 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: id = (java.lang.Integer)value$; break; case 1: title = (java.lang.CharSequence)value$; break; case 2: namespace = (java.lang.Integer)value$; break; case 3: forwarded = (java.lang.Boolean)value$; break; case 4: sentenceIndexes = (java.util.List<java.lang.Integer>)value$; break; default: throw new org.apache.avro.AvroRuntimeException("Bad index"); } } /** * Gets the value of the 'id' field. */ public java.lang.Integer getId() { return id; } /** * Sets the value of the 'id' field. * @param value the value to set. */ public void setId(java.lang.Integer value) { this.id = value; } /** * Gets the value of the 'title' field. */ public java.lang.CharSequence getTitle() { return title; } /** * Sets the value of the 'title' field. * @param value the value to set. */ public void setTitle(java.lang.CharSequence value) { this.title = value; } /** * Gets the value of the 'namespace' field. */ public java.lang.Integer getNamespace() { return namespace; } /** * Sets the value of the 'namespace' field. * @param value the value to set. */ public void setNamespace(java.lang.Integer value) { this.namespace = value; } /** * Gets the value of the 'forwarded' field. */ public java.lang.Boolean getForwarded() { return forwarded; } /** * Sets the value of the 'forwarded' field. * @param value the value to set. */ public void setForwarded(java.lang.Boolean value) { this.forwarded = value; } /** * Gets the value of the 'sentenceIndexes' field. */ public java.util.List<java.lang.Integer> getSentenceIndexes() { return sentenceIndexes; } /** * Sets the value of the 'sentenceIndexes' field. * @param value the value to set. */ public void setSentenceIndexes(java.util.List<java.lang.Integer> value) { this.sentenceIndexes = value; } /** Creates a new LinkSummary RecordBuilder */ public static org.wikipedia.miner.extract.model.struct.LinkSummary.Builder newBuilder() { return new org.wikipedia.miner.extract.model.struct.LinkSummary.Builder(); } /** Creates a new LinkSummary RecordBuilder by copying an existing Builder */ public static org.wikipedia.miner.extract.model.struct.LinkSummary.Builder newBuilder(org.wikipedia.miner.extract.model.struct.LinkSummary.Builder other) { return new org.wikipedia.miner.extract.model.struct.LinkSummary.Builder(other); } /** Creates a new LinkSummary RecordBuilder by copying an existing LinkSummary instance */ public static org.wikipedia.miner.extract.model.struct.LinkSummary.Builder newBuilder(org.wikipedia.miner.extract.model.struct.LinkSummary other) { return new org.wikipedia.miner.extract.model.struct.LinkSummary.Builder(other); } /** * RecordBuilder for LinkSummary instances. */ public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<LinkSummary> implements org.apache.avro.data.RecordBuilder<LinkSummary> { private int id; private java.lang.CharSequence title; private int namespace; private boolean forwarded; private java.util.List<java.lang.Integer> sentenceIndexes; /** Creates a new Builder */ private Builder() { super(org.wikipedia.miner.extract.model.struct.LinkSummary.SCHEMA$); } /** Creates a Builder by copying an existing Builder */ private Builder(org.wikipedia.miner.extract.model.struct.LinkSummary.Builder other) { super(other); if (isValidValue(fields()[0], other.id)) { this.id = data().deepCopy(fields()[0].schema(), other.id); fieldSetFlags()[0] = true; } if (isValidValue(fields()[1], other.title)) { this.title = data().deepCopy(fields()[1].schema(), other.title); fieldSetFlags()[1] = true; } if (isValidValue(fields()[2], other.namespace)) { this.namespace = data().deepCopy(fields()[2].schema(), other.namespace); fieldSetFlags()[2] = true; } if (isValidValue(fields()[3], other.forwarded)) { this.forwarded = data().deepCopy(fields()[3].schema(), other.forwarded); fieldSetFlags()[3] = true; } if (isValidValue(fields()[4], other.sentenceIndexes)) { this.sentenceIndexes = data().deepCopy(fields()[4].schema(), other.sentenceIndexes); fieldSetFlags()[4] = true; } } /** Creates a Builder by copying an existing LinkSummary instance */ private Builder(org.wikipedia.miner.extract.model.struct.LinkSummary other) { super(org.wikipedia.miner.extract.model.struct.LinkSummary.SCHEMA$); if (isValidValue(fields()[0], other.id)) { this.id = data().deepCopy(fields()[0].schema(), other.id); fieldSetFlags()[0] = true; } if (isValidValue(fields()[1], other.title)) { this.title = data().deepCopy(fields()[1].schema(), other.title); fieldSetFlags()[1] = true; } if (isValidValue(fields()[2], other.namespace)) { this.namespace = data().deepCopy(fields()[2].schema(), other.namespace); fieldSetFlags()[2] = true; } if (isValidValue(fields()[3], other.forwarded)) { this.forwarded = data().deepCopy(fields()[3].schema(), other.forwarded); fieldSetFlags()[3] = true; } if (isValidValue(fields()[4], other.sentenceIndexes)) { this.sentenceIndexes = data().deepCopy(fields()[4].schema(), other.sentenceIndexes); fieldSetFlags()[4] = true; } } /** Gets the value of the 'id' field */ public java.lang.Integer getId() { return id; } /** Sets the value of the 'id' field */ public org.wikipedia.miner.extract.model.struct.LinkSummary.Builder setId(int value) { validate(fields()[0], value); this.id = value; fieldSetFlags()[0] = true; return this; } /** Checks whether the 'id' field has been set */ public boolean hasId() { return fieldSetFlags()[0]; } /** Clears the value of the 'id' field */ public org.wikipedia.miner.extract.model.struct.LinkSummary.Builder clearId() { fieldSetFlags()[0] = false; return this; } /** Gets the value of the 'title' field */ public java.lang.CharSequence getTitle() { return title; } /** Sets the value of the 'title' field */ public org.wikipedia.miner.extract.model.struct.LinkSummary.Builder setTitle(java.lang.CharSequence value) { validate(fields()[1], value); this.title = value; fieldSetFlags()[1] = true; return this; } /** Checks whether the 'title' field has been set */ public boolean hasTitle() { return fieldSetFlags()[1]; } /** Clears the value of the 'title' field */ public org.wikipedia.miner.extract.model.struct.LinkSummary.Builder clearTitle() { title = null; fieldSetFlags()[1] = false; return this; } /** Gets the value of the 'namespace' field */ public java.lang.Integer getNamespace() { return namespace; } /** Sets the value of the 'namespace' field */ public org.wikipedia.miner.extract.model.struct.LinkSummary.Builder setNamespace(int value) { validate(fields()[2], value); this.namespace = value; fieldSetFlags()[2] = true; return this; } /** Checks whether the 'namespace' field has been set */ public boolean hasNamespace() { return fieldSetFlags()[2]; } /** Clears the value of the 'namespace' field */ public org.wikipedia.miner.extract.model.struct.LinkSummary.Builder clearNamespace() { fieldSetFlags()[2] = false; return this; } /** Gets the value of the 'forwarded' field */ public java.lang.Boolean getForwarded() { return forwarded; } /** Sets the value of the 'forwarded' field */ public org.wikipedia.miner.extract.model.struct.LinkSummary.Builder setForwarded(boolean value) { validate(fields()[3], value); this.forwarded = value; fieldSetFlags()[3] = true; return this; } /** Checks whether the 'forwarded' field has been set */ public boolean hasForwarded() { return fieldSetFlags()[3]; } /** Clears the value of the 'forwarded' field */ public org.wikipedia.miner.extract.model.struct.LinkSummary.Builder clearForwarded() { fieldSetFlags()[3] = false; return this; } /** Gets the value of the 'sentenceIndexes' field */ public java.util.List<java.lang.Integer> getSentenceIndexes() { return sentenceIndexes; } /** Sets the value of the 'sentenceIndexes' field */ public org.wikipedia.miner.extract.model.struct.LinkSummary.Builder setSentenceIndexes(java.util.List<java.lang.Integer> value) { validate(fields()[4], value); this.sentenceIndexes = value; fieldSetFlags()[4] = true; return this; } /** Checks whether the 'sentenceIndexes' field has been set */ public boolean hasSentenceIndexes() { return fieldSetFlags()[4]; } /** Clears the value of the 'sentenceIndexes' field */ public org.wikipedia.miner.extract.model.struct.LinkSummary.Builder clearSentenceIndexes() { sentenceIndexes = null; fieldSetFlags()[4] = false; return this; } @Override public LinkSummary build() { try { LinkSummary record = new LinkSummary(); record.id = fieldSetFlags()[0] ? this.id : (java.lang.Integer) defaultValue(fields()[0]); record.title = fieldSetFlags()[1] ? this.title : (java.lang.CharSequence) defaultValue(fields()[1]); record.namespace = fieldSetFlags()[2] ? this.namespace : (java.lang.Integer) defaultValue(fields()[2]); record.forwarded = fieldSetFlags()[3] ? this.forwarded : (java.lang.Boolean) defaultValue(fields()[3]); record.sentenceIndexes = fieldSetFlags()[4] ? this.sentenceIndexes : (java.util.List<java.lang.Integer>) defaultValue(fields()[4]); return record; } catch (Exception e) { throw new org.apache.avro.AvroRuntimeException(e); } } } }