/**
* Autogenerated by Avro
*
* DO NOT EDIT DIRECTLY
*/
package org.wikipedia.miner.extract.model.struct;
@SuppressWarnings("all")
@org.apache.avro.specific.AvroGenerated
public class PageKey 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\":\"PageKey\",\"namespace\":\"org.wikipedia.miner.extract.model.struct\",\"fields\":[{\"name\":\"namespace\",\"type\":\"int\"},{\"name\":\"title\",\"type\":\"string\"}]}");
public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; }
@Deprecated public int namespace;
@Deprecated public java.lang.CharSequence title;
/**
* 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 PageKey() {}
/**
* All-args constructor.
*/
public PageKey(java.lang.Integer namespace, java.lang.CharSequence title) {
this.namespace = namespace;
this.title = title;
}
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 namespace;
case 1: return title;
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: namespace = (java.lang.Integer)value$; break;
case 1: title = (java.lang.CharSequence)value$; break;
default: throw new org.apache.avro.AvroRuntimeException("Bad index");
}
}
/**
* 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 '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;
}
/** Creates a new PageKey RecordBuilder */
public static org.wikipedia.miner.extract.model.struct.PageKey.Builder newBuilder() {
return new org.wikipedia.miner.extract.model.struct.PageKey.Builder();
}
/** Creates a new PageKey RecordBuilder by copying an existing Builder */
public static org.wikipedia.miner.extract.model.struct.PageKey.Builder newBuilder(org.wikipedia.miner.extract.model.struct.PageKey.Builder other) {
return new org.wikipedia.miner.extract.model.struct.PageKey.Builder(other);
}
/** Creates a new PageKey RecordBuilder by copying an existing PageKey instance */
public static org.wikipedia.miner.extract.model.struct.PageKey.Builder newBuilder(org.wikipedia.miner.extract.model.struct.PageKey other) {
return new org.wikipedia.miner.extract.model.struct.PageKey.Builder(other);
}
/**
* RecordBuilder for PageKey instances.
*/
public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<PageKey>
implements org.apache.avro.data.RecordBuilder<PageKey> {
private int namespace;
private java.lang.CharSequence title;
/** Creates a new Builder */
private Builder() {
super(org.wikipedia.miner.extract.model.struct.PageKey.SCHEMA$);
}
/** Creates a Builder by copying an existing Builder */
private Builder(org.wikipedia.miner.extract.model.struct.PageKey.Builder other) {
super(other);
if (isValidValue(fields()[0], other.namespace)) {
this.namespace = data().deepCopy(fields()[0].schema(), other.namespace);
fieldSetFlags()[0] = true;
}
if (isValidValue(fields()[1], other.title)) {
this.title = data().deepCopy(fields()[1].schema(), other.title);
fieldSetFlags()[1] = true;
}
}
/** Creates a Builder by copying an existing PageKey instance */
private Builder(org.wikipedia.miner.extract.model.struct.PageKey other) {
super(org.wikipedia.miner.extract.model.struct.PageKey.SCHEMA$);
if (isValidValue(fields()[0], other.namespace)) {
this.namespace = data().deepCopy(fields()[0].schema(), other.namespace);
fieldSetFlags()[0] = true;
}
if (isValidValue(fields()[1], other.title)) {
this.title = data().deepCopy(fields()[1].schema(), other.title);
fieldSetFlags()[1] = true;
}
}
/** 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.PageKey.Builder setNamespace(int value) {
validate(fields()[0], value);
this.namespace = value;
fieldSetFlags()[0] = true;
return this;
}
/** Checks whether the 'namespace' field has been set */
public boolean hasNamespace() {
return fieldSetFlags()[0];
}
/** Clears the value of the 'namespace' field */
public org.wikipedia.miner.extract.model.struct.PageKey.Builder clearNamespace() {
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.PageKey.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.PageKey.Builder clearTitle() {
title = null;
fieldSetFlags()[1] = false;
return this;
}
@Override
public PageKey build() {
try {
PageKey record = new PageKey();
record.namespace = fieldSetFlags()[0] ? this.namespace : (java.lang.Integer) defaultValue(fields()[0]);
record.title = fieldSetFlags()[1] ? this.title : (java.lang.CharSequence) defaultValue(fields()[1]);
return record;
} catch (Exception e) {
throw new org.apache.avro.AvroRuntimeException(e);
}
}
}
}