/** * Autogenerated by Avro * * DO NOT EDIT DIRECTLY */ package org.wikipedia.miner.extract.model.struct; @SuppressWarnings("all") @org.apache.avro.specific.AvroGenerated public class LabelOccurrences 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\":\"LabelOccurrences\",\"namespace\":\"org.wikipedia.miner.extract.model.struct\",\"fields\":[{\"name\":\"linkDocCount\",\"type\":\"int\"},{\"name\":\"linkOccCount\",\"type\":\"int\"},{\"name\":\"textDocCount\",\"type\":\"int\"},{\"name\":\"textOccCount\",\"type\":\"int\"}]}"); public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; } @Deprecated public int linkDocCount; @Deprecated public int linkOccCount; @Deprecated public int textDocCount; @Deprecated public int textOccCount; /** * 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 LabelOccurrences() {} /** * All-args constructor. */ public LabelOccurrences(java.lang.Integer linkDocCount, java.lang.Integer linkOccCount, java.lang.Integer textDocCount, java.lang.Integer textOccCount) { this.linkDocCount = linkDocCount; this.linkOccCount = linkOccCount; this.textDocCount = textDocCount; this.textOccCount = textOccCount; } 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 linkDocCount; case 1: return linkOccCount; case 2: return textDocCount; case 3: return textOccCount; 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: linkDocCount = (java.lang.Integer)value$; break; case 1: linkOccCount = (java.lang.Integer)value$; break; case 2: textDocCount = (java.lang.Integer)value$; break; case 3: textOccCount = (java.lang.Integer)value$; break; default: throw new org.apache.avro.AvroRuntimeException("Bad index"); } } /** * Gets the value of the 'linkDocCount' field. */ public java.lang.Integer getLinkDocCount() { return linkDocCount; } /** * Sets the value of the 'linkDocCount' field. * @param value the value to set. */ public void setLinkDocCount(java.lang.Integer value) { this.linkDocCount = value; } /** * Gets the value of the 'linkOccCount' field. */ public java.lang.Integer getLinkOccCount() { return linkOccCount; } /** * Sets the value of the 'linkOccCount' field. * @param value the value to set. */ public void setLinkOccCount(java.lang.Integer value) { this.linkOccCount = value; } /** * Gets the value of the 'textDocCount' field. */ public java.lang.Integer getTextDocCount() { return textDocCount; } /** * Sets the value of the 'textDocCount' field. * @param value the value to set. */ public void setTextDocCount(java.lang.Integer value) { this.textDocCount = value; } /** * Gets the value of the 'textOccCount' field. */ public java.lang.Integer getTextOccCount() { return textOccCount; } /** * Sets the value of the 'textOccCount' field. * @param value the value to set. */ public void setTextOccCount(java.lang.Integer value) { this.textOccCount = value; } /** Creates a new LabelOccurrences RecordBuilder */ public static org.wikipedia.miner.extract.model.struct.LabelOccurrences.Builder newBuilder() { return new org.wikipedia.miner.extract.model.struct.LabelOccurrences.Builder(); } /** Creates a new LabelOccurrences RecordBuilder by copying an existing Builder */ public static org.wikipedia.miner.extract.model.struct.LabelOccurrences.Builder newBuilder(org.wikipedia.miner.extract.model.struct.LabelOccurrences.Builder other) { return new org.wikipedia.miner.extract.model.struct.LabelOccurrences.Builder(other); } /** Creates a new LabelOccurrences RecordBuilder by copying an existing LabelOccurrences instance */ public static org.wikipedia.miner.extract.model.struct.LabelOccurrences.Builder newBuilder(org.wikipedia.miner.extract.model.struct.LabelOccurrences other) { return new org.wikipedia.miner.extract.model.struct.LabelOccurrences.Builder(other); } /** * RecordBuilder for LabelOccurrences instances. */ public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<LabelOccurrences> implements org.apache.avro.data.RecordBuilder<LabelOccurrences> { private int linkDocCount; private int linkOccCount; private int textDocCount; private int textOccCount; /** Creates a new Builder */ private Builder() { super(org.wikipedia.miner.extract.model.struct.LabelOccurrences.SCHEMA$); } /** Creates a Builder by copying an existing Builder */ private Builder(org.wikipedia.miner.extract.model.struct.LabelOccurrences.Builder other) { super(other); if (isValidValue(fields()[0], other.linkDocCount)) { this.linkDocCount = data().deepCopy(fields()[0].schema(), other.linkDocCount); fieldSetFlags()[0] = true; } if (isValidValue(fields()[1], other.linkOccCount)) { this.linkOccCount = data().deepCopy(fields()[1].schema(), other.linkOccCount); fieldSetFlags()[1] = true; } if (isValidValue(fields()[2], other.textDocCount)) { this.textDocCount = data().deepCopy(fields()[2].schema(), other.textDocCount); fieldSetFlags()[2] = true; } if (isValidValue(fields()[3], other.textOccCount)) { this.textOccCount = data().deepCopy(fields()[3].schema(), other.textOccCount); fieldSetFlags()[3] = true; } } /** Creates a Builder by copying an existing LabelOccurrences instance */ private Builder(org.wikipedia.miner.extract.model.struct.LabelOccurrences other) { super(org.wikipedia.miner.extract.model.struct.LabelOccurrences.SCHEMA$); if (isValidValue(fields()[0], other.linkDocCount)) { this.linkDocCount = data().deepCopy(fields()[0].schema(), other.linkDocCount); fieldSetFlags()[0] = true; } if (isValidValue(fields()[1], other.linkOccCount)) { this.linkOccCount = data().deepCopy(fields()[1].schema(), other.linkOccCount); fieldSetFlags()[1] = true; } if (isValidValue(fields()[2], other.textDocCount)) { this.textDocCount = data().deepCopy(fields()[2].schema(), other.textDocCount); fieldSetFlags()[2] = true; } if (isValidValue(fields()[3], other.textOccCount)) { this.textOccCount = data().deepCopy(fields()[3].schema(), other.textOccCount); fieldSetFlags()[3] = true; } } /** Gets the value of the 'linkDocCount' field */ public java.lang.Integer getLinkDocCount() { return linkDocCount; } /** Sets the value of the 'linkDocCount' field */ public org.wikipedia.miner.extract.model.struct.LabelOccurrences.Builder setLinkDocCount(int value) { validate(fields()[0], value); this.linkDocCount = value; fieldSetFlags()[0] = true; return this; } /** Checks whether the 'linkDocCount' field has been set */ public boolean hasLinkDocCount() { return fieldSetFlags()[0]; } /** Clears the value of the 'linkDocCount' field */ public org.wikipedia.miner.extract.model.struct.LabelOccurrences.Builder clearLinkDocCount() { fieldSetFlags()[0] = false; return this; } /** Gets the value of the 'linkOccCount' field */ public java.lang.Integer getLinkOccCount() { return linkOccCount; } /** Sets the value of the 'linkOccCount' field */ public org.wikipedia.miner.extract.model.struct.LabelOccurrences.Builder setLinkOccCount(int value) { validate(fields()[1], value); this.linkOccCount = value; fieldSetFlags()[1] = true; return this; } /** Checks whether the 'linkOccCount' field has been set */ public boolean hasLinkOccCount() { return fieldSetFlags()[1]; } /** Clears the value of the 'linkOccCount' field */ public org.wikipedia.miner.extract.model.struct.LabelOccurrences.Builder clearLinkOccCount() { fieldSetFlags()[1] = false; return this; } /** Gets the value of the 'textDocCount' field */ public java.lang.Integer getTextDocCount() { return textDocCount; } /** Sets the value of the 'textDocCount' field */ public org.wikipedia.miner.extract.model.struct.LabelOccurrences.Builder setTextDocCount(int value) { validate(fields()[2], value); this.textDocCount = value; fieldSetFlags()[2] = true; return this; } /** Checks whether the 'textDocCount' field has been set */ public boolean hasTextDocCount() { return fieldSetFlags()[2]; } /** Clears the value of the 'textDocCount' field */ public org.wikipedia.miner.extract.model.struct.LabelOccurrences.Builder clearTextDocCount() { fieldSetFlags()[2] = false; return this; } /** Gets the value of the 'textOccCount' field */ public java.lang.Integer getTextOccCount() { return textOccCount; } /** Sets the value of the 'textOccCount' field */ public org.wikipedia.miner.extract.model.struct.LabelOccurrences.Builder setTextOccCount(int value) { validate(fields()[3], value); this.textOccCount = value; fieldSetFlags()[3] = true; return this; } /** Checks whether the 'textOccCount' field has been set */ public boolean hasTextOccCount() { return fieldSetFlags()[3]; } /** Clears the value of the 'textOccCount' field */ public org.wikipedia.miner.extract.model.struct.LabelOccurrences.Builder clearTextOccCount() { fieldSetFlags()[3] = false; return this; } @Override public LabelOccurrences build() { try { LabelOccurrences record = new LabelOccurrences(); record.linkDocCount = fieldSetFlags()[0] ? this.linkDocCount : (java.lang.Integer) defaultValue(fields()[0]); record.linkOccCount = fieldSetFlags()[1] ? this.linkOccCount : (java.lang.Integer) defaultValue(fields()[1]); record.textDocCount = fieldSetFlags()[2] ? this.textDocCount : (java.lang.Integer) defaultValue(fields()[2]); record.textOccCount = fieldSetFlags()[3] ? this.textOccCount : (java.lang.Integer) defaultValue(fields()[3]); return record; } catch (Exception e) { throw new org.apache.avro.AvroRuntimeException(e); } } } }