/**
* Autogenerated by Avro
*
* DO NOT EDIT DIRECTLY
*/
package se.lth.cs.koshik.model.avro;
@SuppressWarnings("all")
@org.apache.avro.specific.AvroGenerated
public class AvroDocument 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\":\"AvroDocument\",\"namespace\":\"se.lth.cs.koshik.model.avro\",\"fields\":[{\"name\":\"identifier\",\"type\":\"string\",\"default\":\"\"},{\"name\":\"title\",\"type\":\"string\",\"default\":\"\"},{\"name\":\"revision\",\"type\":\"string\",\"default\":\"\"},{\"name\":\"language\",\"type\":\"string\",\"default\":\"\"},{\"name\":\"encoding\",\"type\":\"string\",\"default\":\"\"},{\"name\":\"source\",\"type\":\"string\",\"default\":\"\"},{\"name\":\"content\",\"type\":\"string\",\"default\":\"\"},{\"name\":\"attributes\",\"type\":{\"type\":\"map\",\"values\":\"string\"}},{\"name\":\"annotations\",\"type\":{\"type\":\"array\",\"items\":{\"type\":\"record\",\"name\":\"AvroAnnotation\",\"fields\":[{\"name\":\"layer\",\"type\":\"string\",\"default\":\"\"},{\"name\":\"begin\",\"type\":\"int\",\"default\":-1},{\"name\":\"end\",\"type\":\"int\",\"default\":-1},{\"name\":\"content\",\"type\":\"string\",\"default\":\"\"},{\"name\":\"features\",\"type\":{\"type\":\"map\",\"values\":\"string\"}}]}}}]}");
public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; }
@Deprecated public java.lang.CharSequence identifier;
@Deprecated public java.lang.CharSequence title;
@Deprecated public java.lang.CharSequence revision;
@Deprecated public java.lang.CharSequence language;
@Deprecated public java.lang.CharSequence encoding;
@Deprecated public java.lang.CharSequence source;
@Deprecated public java.lang.CharSequence content;
@Deprecated public java.util.Map<java.lang.CharSequence,java.lang.CharSequence> attributes;
@Deprecated public java.util.List<se.lth.cs.koshik.model.avro.AvroAnnotation> annotations;
/**
* Default constructor. Note that this does not initialize fields
* to their default values from the schema. If that is desired then
* one should use <code>newBuilder()</code>.
*/
public AvroDocument() {}
/**
* All-args constructor.
*/
public AvroDocument(java.lang.CharSequence identifier, java.lang.CharSequence title, java.lang.CharSequence revision, java.lang.CharSequence language, java.lang.CharSequence encoding, java.lang.CharSequence source, java.lang.CharSequence content, java.util.Map<java.lang.CharSequence,java.lang.CharSequence> attributes, java.util.List<se.lth.cs.koshik.model.avro.AvroAnnotation> annotations) {
this.identifier = identifier;
this.title = title;
this.revision = revision;
this.language = language;
this.encoding = encoding;
this.source = source;
this.content = content;
this.attributes = attributes;
this.annotations = annotations;
}
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 identifier;
case 1: return title;
case 2: return revision;
case 3: return language;
case 4: return encoding;
case 5: return source;
case 6: return content;
case 7: return attributes;
case 8: return annotations;
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: identifier = (java.lang.CharSequence)value$; break;
case 1: title = (java.lang.CharSequence)value$; break;
case 2: revision = (java.lang.CharSequence)value$; break;
case 3: language = (java.lang.CharSequence)value$; break;
case 4: encoding = (java.lang.CharSequence)value$; break;
case 5: source = (java.lang.CharSequence)value$; break;
case 6: content = (java.lang.CharSequence)value$; break;
case 7: attributes = (java.util.Map<java.lang.CharSequence,java.lang.CharSequence>)value$; break;
case 8: annotations = (java.util.List<se.lth.cs.koshik.model.avro.AvroAnnotation>)value$; break;
default: throw new org.apache.avro.AvroRuntimeException("Bad index");
}
}
/**
* Gets the value of the 'identifier' field.
*/
public java.lang.CharSequence getIdentifier() {
return identifier;
}
/**
* Sets the value of the 'identifier' field.
* @param value the value to set.
*/
public void setIdentifier(java.lang.CharSequence value) {
this.identifier = 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 'revision' field.
*/
public java.lang.CharSequence getRevision() {
return revision;
}
/**
* Sets the value of the 'revision' field.
* @param value the value to set.
*/
public void setRevision(java.lang.CharSequence value) {
this.revision = value;
}
/**
* Gets the value of the 'language' field.
*/
public java.lang.CharSequence getLanguage() {
return language;
}
/**
* Sets the value of the 'language' field.
* @param value the value to set.
*/
public void setLanguage(java.lang.CharSequence value) {
this.language = value;
}
/**
* Gets the value of the 'encoding' field.
*/
public java.lang.CharSequence getEncoding() {
return encoding;
}
/**
* Sets the value of the 'encoding' field.
* @param value the value to set.
*/
public void setEncoding(java.lang.CharSequence value) {
this.encoding = value;
}
/**
* Gets the value of the 'source' field.
*/
public java.lang.CharSequence getSource() {
return source;
}
/**
* Sets the value of the 'source' field.
* @param value the value to set.
*/
public void setSource(java.lang.CharSequence value) {
this.source = value;
}
/**
* Gets the value of the 'content' field.
*/
public java.lang.CharSequence getContent() {
return content;
}
/**
* Sets the value of the 'content' field.
* @param value the value to set.
*/
public void setContent(java.lang.CharSequence value) {
this.content = value;
}
/**
* Gets the value of the 'attributes' field.
*/
public java.util.Map<java.lang.CharSequence,java.lang.CharSequence> getAttributes() {
return attributes;
}
/**
* Sets the value of the 'attributes' field.
* @param value the value to set.
*/
public void setAttributes(java.util.Map<java.lang.CharSequence,java.lang.CharSequence> value) {
this.attributes = value;
}
/**
* Gets the value of the 'annotations' field.
*/
public java.util.List<se.lth.cs.koshik.model.avro.AvroAnnotation> getAnnotations() {
return annotations;
}
/**
* Sets the value of the 'annotations' field.
* @param value the value to set.
*/
public void setAnnotations(java.util.List<se.lth.cs.koshik.model.avro.AvroAnnotation> value) {
this.annotations = value;
}
/** Creates a new AvroDocument RecordBuilder */
public static se.lth.cs.koshik.model.avro.AvroDocument.Builder newBuilder() {
return new se.lth.cs.koshik.model.avro.AvroDocument.Builder();
}
/** Creates a new AvroDocument RecordBuilder by copying an existing Builder */
public static se.lth.cs.koshik.model.avro.AvroDocument.Builder newBuilder(se.lth.cs.koshik.model.avro.AvroDocument.Builder other) {
return new se.lth.cs.koshik.model.avro.AvroDocument.Builder(other);
}
/** Creates a new AvroDocument RecordBuilder by copying an existing AvroDocument instance */
public static se.lth.cs.koshik.model.avro.AvroDocument.Builder newBuilder(se.lth.cs.koshik.model.avro.AvroDocument other) {
return new se.lth.cs.koshik.model.avro.AvroDocument.Builder(other);
}
/**
* RecordBuilder for AvroDocument instances.
*/
public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<AvroDocument>
implements org.apache.avro.data.RecordBuilder<AvroDocument> {
private java.lang.CharSequence identifier;
private java.lang.CharSequence title;
private java.lang.CharSequence revision;
private java.lang.CharSequence language;
private java.lang.CharSequence encoding;
private java.lang.CharSequence source;
private java.lang.CharSequence content;
private java.util.Map<java.lang.CharSequence,java.lang.CharSequence> attributes;
private java.util.List<se.lth.cs.koshik.model.avro.AvroAnnotation> annotations;
/** Creates a new Builder */
private Builder() {
super(se.lth.cs.koshik.model.avro.AvroDocument.SCHEMA$);
}
/** Creates a Builder by copying an existing Builder */
private Builder(se.lth.cs.koshik.model.avro.AvroDocument.Builder other) {
super(other);
if (isValidValue(fields()[0], other.identifier)) {
this.identifier = data().deepCopy(fields()[0].schema(), other.identifier);
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.revision)) {
this.revision = data().deepCopy(fields()[2].schema(), other.revision);
fieldSetFlags()[2] = true;
}
if (isValidValue(fields()[3], other.language)) {
this.language = data().deepCopy(fields()[3].schema(), other.language);
fieldSetFlags()[3] = true;
}
if (isValidValue(fields()[4], other.encoding)) {
this.encoding = data().deepCopy(fields()[4].schema(), other.encoding);
fieldSetFlags()[4] = true;
}
if (isValidValue(fields()[5], other.source)) {
this.source = data().deepCopy(fields()[5].schema(), other.source);
fieldSetFlags()[5] = true;
}
if (isValidValue(fields()[6], other.content)) {
this.content = data().deepCopy(fields()[6].schema(), other.content);
fieldSetFlags()[6] = true;
}
if (isValidValue(fields()[7], other.attributes)) {
this.attributes = data().deepCopy(fields()[7].schema(), other.attributes);
fieldSetFlags()[7] = true;
}
if (isValidValue(fields()[8], other.annotations)) {
this.annotations = data().deepCopy(fields()[8].schema(), other.annotations);
fieldSetFlags()[8] = true;
}
}
/** Creates a Builder by copying an existing AvroDocument instance */
private Builder(se.lth.cs.koshik.model.avro.AvroDocument other) {
super(se.lth.cs.koshik.model.avro.AvroDocument.SCHEMA$);
if (isValidValue(fields()[0], other.identifier)) {
this.identifier = data().deepCopy(fields()[0].schema(), other.identifier);
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.revision)) {
this.revision = data().deepCopy(fields()[2].schema(), other.revision);
fieldSetFlags()[2] = true;
}
if (isValidValue(fields()[3], other.language)) {
this.language = data().deepCopy(fields()[3].schema(), other.language);
fieldSetFlags()[3] = true;
}
if (isValidValue(fields()[4], other.encoding)) {
this.encoding = data().deepCopy(fields()[4].schema(), other.encoding);
fieldSetFlags()[4] = true;
}
if (isValidValue(fields()[5], other.source)) {
this.source = data().deepCopy(fields()[5].schema(), other.source);
fieldSetFlags()[5] = true;
}
if (isValidValue(fields()[6], other.content)) {
this.content = data().deepCopy(fields()[6].schema(), other.content);
fieldSetFlags()[6] = true;
}
if (isValidValue(fields()[7], other.attributes)) {
this.attributes = data().deepCopy(fields()[7].schema(), other.attributes);
fieldSetFlags()[7] = true;
}
if (isValidValue(fields()[8], other.annotations)) {
this.annotations = data().deepCopy(fields()[8].schema(), other.annotations);
fieldSetFlags()[8] = true;
}
}
/** Gets the value of the 'identifier' field */
public java.lang.CharSequence getIdentifier() {
return identifier;
}
/** Sets the value of the 'identifier' field */
public se.lth.cs.koshik.model.avro.AvroDocument.Builder setIdentifier(java.lang.CharSequence value) {
validate(fields()[0], value);
this.identifier = value;
fieldSetFlags()[0] = true;
return this;
}
/** Checks whether the 'identifier' field has been set */
public boolean hasIdentifier() {
return fieldSetFlags()[0];
}
/** Clears the value of the 'identifier' field */
public se.lth.cs.koshik.model.avro.AvroDocument.Builder clearIdentifier() {
identifier = null;
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 se.lth.cs.koshik.model.avro.AvroDocument.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 se.lth.cs.koshik.model.avro.AvroDocument.Builder clearTitle() {
title = null;
fieldSetFlags()[1] = false;
return this;
}
/** Gets the value of the 'revision' field */
public java.lang.CharSequence getRevision() {
return revision;
}
/** Sets the value of the 'revision' field */
public se.lth.cs.koshik.model.avro.AvroDocument.Builder setRevision(java.lang.CharSequence value) {
validate(fields()[2], value);
this.revision = value;
fieldSetFlags()[2] = true;
return this;
}
/** Checks whether the 'revision' field has been set */
public boolean hasRevision() {
return fieldSetFlags()[2];
}
/** Clears the value of the 'revision' field */
public se.lth.cs.koshik.model.avro.AvroDocument.Builder clearRevision() {
revision = null;
fieldSetFlags()[2] = false;
return this;
}
/** Gets the value of the 'language' field */
public java.lang.CharSequence getLanguage() {
return language;
}
/** Sets the value of the 'language' field */
public se.lth.cs.koshik.model.avro.AvroDocument.Builder setLanguage(java.lang.CharSequence value) {
validate(fields()[3], value);
this.language = value;
fieldSetFlags()[3] = true;
return this;
}
/** Checks whether the 'language' field has been set */
public boolean hasLanguage() {
return fieldSetFlags()[3];
}
/** Clears the value of the 'language' field */
public se.lth.cs.koshik.model.avro.AvroDocument.Builder clearLanguage() {
language = null;
fieldSetFlags()[3] = false;
return this;
}
/** Gets the value of the 'encoding' field */
public java.lang.CharSequence getEncoding() {
return encoding;
}
/** Sets the value of the 'encoding' field */
public se.lth.cs.koshik.model.avro.AvroDocument.Builder setEncoding(java.lang.CharSequence value) {
validate(fields()[4], value);
this.encoding = value;
fieldSetFlags()[4] = true;
return this;
}
/** Checks whether the 'encoding' field has been set */
public boolean hasEncoding() {
return fieldSetFlags()[4];
}
/** Clears the value of the 'encoding' field */
public se.lth.cs.koshik.model.avro.AvroDocument.Builder clearEncoding() {
encoding = null;
fieldSetFlags()[4] = false;
return this;
}
/** Gets the value of the 'source' field */
public java.lang.CharSequence getSource() {
return source;
}
/** Sets the value of the 'source' field */
public se.lth.cs.koshik.model.avro.AvroDocument.Builder setSource(java.lang.CharSequence value) {
validate(fields()[5], value);
this.source = value;
fieldSetFlags()[5] = true;
return this;
}
/** Checks whether the 'source' field has been set */
public boolean hasSource() {
return fieldSetFlags()[5];
}
/** Clears the value of the 'source' field */
public se.lth.cs.koshik.model.avro.AvroDocument.Builder clearSource() {
source = null;
fieldSetFlags()[5] = false;
return this;
}
/** Gets the value of the 'content' field */
public java.lang.CharSequence getContent() {
return content;
}
/** Sets the value of the 'content' field */
public se.lth.cs.koshik.model.avro.AvroDocument.Builder setContent(java.lang.CharSequence value) {
validate(fields()[6], value);
this.content = value;
fieldSetFlags()[6] = true;
return this;
}
/** Checks whether the 'content' field has been set */
public boolean hasContent() {
return fieldSetFlags()[6];
}
/** Clears the value of the 'content' field */
public se.lth.cs.koshik.model.avro.AvroDocument.Builder clearContent() {
content = null;
fieldSetFlags()[6] = false;
return this;
}
/** Gets the value of the 'attributes' field */
public java.util.Map<java.lang.CharSequence,java.lang.CharSequence> getAttributes() {
return attributes;
}
/** Sets the value of the 'attributes' field */
public se.lth.cs.koshik.model.avro.AvroDocument.Builder setAttributes(java.util.Map<java.lang.CharSequence,java.lang.CharSequence> value) {
validate(fields()[7], value);
this.attributes = value;
fieldSetFlags()[7] = true;
return this;
}
/** Checks whether the 'attributes' field has been set */
public boolean hasAttributes() {
return fieldSetFlags()[7];
}
/** Clears the value of the 'attributes' field */
public se.lth.cs.koshik.model.avro.AvroDocument.Builder clearAttributes() {
attributes = null;
fieldSetFlags()[7] = false;
return this;
}
/** Gets the value of the 'annotations' field */
public java.util.List<se.lth.cs.koshik.model.avro.AvroAnnotation> getAnnotations() {
return annotations;
}
/** Sets the value of the 'annotations' field */
public se.lth.cs.koshik.model.avro.AvroDocument.Builder setAnnotations(java.util.List<se.lth.cs.koshik.model.avro.AvroAnnotation> value) {
validate(fields()[8], value);
this.annotations = value;
fieldSetFlags()[8] = true;
return this;
}
/** Checks whether the 'annotations' field has been set */
public boolean hasAnnotations() {
return fieldSetFlags()[8];
}
/** Clears the value of the 'annotations' field */
public se.lth.cs.koshik.model.avro.AvroDocument.Builder clearAnnotations() {
annotations = null;
fieldSetFlags()[8] = false;
return this;
}
@Override
public AvroDocument build() {
try {
AvroDocument record = new AvroDocument();
record.identifier = fieldSetFlags()[0] ? this.identifier : (java.lang.CharSequence) defaultValue(fields()[0]);
record.title = fieldSetFlags()[1] ? this.title : (java.lang.CharSequence) defaultValue(fields()[1]);
record.revision = fieldSetFlags()[2] ? this.revision : (java.lang.CharSequence) defaultValue(fields()[2]);
record.language = fieldSetFlags()[3] ? this.language : (java.lang.CharSequence) defaultValue(fields()[3]);
record.encoding = fieldSetFlags()[4] ? this.encoding : (java.lang.CharSequence) defaultValue(fields()[4]);
record.source = fieldSetFlags()[5] ? this.source : (java.lang.CharSequence) defaultValue(fields()[5]);
record.content = fieldSetFlags()[6] ? this.content : (java.lang.CharSequence) defaultValue(fields()[6]);
record.attributes = fieldSetFlags()[7] ? this.attributes : (java.util.Map<java.lang.CharSequence,java.lang.CharSequence>) defaultValue(fields()[7]);
record.annotations = fieldSetFlags()[8] ? this.annotations : (java.util.List<se.lth.cs.koshik.model.avro.AvroAnnotation>) defaultValue(fields()[8]);
return record;
} catch (Exception e) {
throw new org.apache.avro.AvroRuntimeException(e);
}
}
}
}