org.opencb.biodata.models.variant.avro.OntologyTermAnnotation Maven / Gradle / Ivy
The newest version!
/**
* Autogenerated by Avro
*
* DO NOT EDIT DIRECTLY
*/
package org.opencb.biodata.models.variant.avro;
@SuppressWarnings("all")
@org.apache.avro.specific.AvroGenerated
public class OntologyTermAnnotation 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\":\"OntologyTermAnnotation\",\"namespace\":\"org.opencb.biodata.models.variant.avro\",\"fields\":[{\"name\":\"id\",\"type\":[\"null\",{\"type\":\"string\",\"avro.java.string\":\"String\"}]},{\"name\":\"name\",\"type\":[\"null\",{\"type\":\"string\",\"avro.java.string\":\"String\"}]},{\"name\":\"description\",\"type\":[\"null\",{\"type\":\"string\",\"avro.java.string\":\"String\"}]},{\"name\":\"source\",\"type\":[\"null\",{\"type\":\"string\",\"avro.java.string\":\"String\"}]},{\"name\":\"url\",\"type\":[\"null\",{\"type\":\"string\",\"avro.java.string\":\"String\"}]},{\"name\":\"attributes\",\"type\":[\"null\",{\"type\":\"map\",\"values\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"avro.java.string\":\"String\"}]}]}");
public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; }
private java.lang.String id;
private java.lang.String name;
private java.lang.String description;
private java.lang.String source;
private java.lang.String url;
private java.util.Map attributes;
/**
* Default constructor. Note that this does not initialize fields
* to their default values from the schema. If that is desired then
* one should use newBuilder()
.
*/
public OntologyTermAnnotation() {}
/**
* All-args constructor.
*/
public OntologyTermAnnotation(java.lang.String id, java.lang.String name, java.lang.String description, java.lang.String source, java.lang.String url, java.util.Map attributes) {
this.id = id;
this.name = name;
this.description = description;
this.source = source;
this.url = url;
this.attributes = attributes;
}
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 name;
case 2: return description;
case 3: return source;
case 4: return url;
case 5: return attributes;
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.String)value$; break;
case 1: name = (java.lang.String)value$; break;
case 2: description = (java.lang.String)value$; break;
case 3: source = (java.lang.String)value$; break;
case 4: url = (java.lang.String)value$; break;
case 5: attributes = (java.util.Map)value$; break;
default: throw new org.apache.avro.AvroRuntimeException("Bad index");
}
}
/**
* Gets the value of the 'id' field.
*/
public java.lang.String getId() {
return id;
}
/**
* Sets the value of the 'id' field.
* @param value the value to set.
*/
public void setId(java.lang.String value) {
this.id = value;
}
/**
* Gets the value of the 'name' field.
*/
public java.lang.String getName() {
return name;
}
/**
* Sets the value of the 'name' field.
* @param value the value to set.
*/
public void setName(java.lang.String value) {
this.name = value;
}
/**
* Gets the value of the 'description' field.
*/
public java.lang.String getDescription() {
return description;
}
/**
* Sets the value of the 'description' field.
* @param value the value to set.
*/
public void setDescription(java.lang.String value) {
this.description = value;
}
/**
* Gets the value of the 'source' field.
*/
public java.lang.String getSource() {
return source;
}
/**
* Sets the value of the 'source' field.
* @param value the value to set.
*/
public void setSource(java.lang.String value) {
this.source = value;
}
/**
* Gets the value of the 'url' field.
*/
public java.lang.String getUrl() {
return url;
}
/**
* Sets the value of the 'url' field.
* @param value the value to set.
*/
public void setUrl(java.lang.String value) {
this.url = value;
}
/**
* Gets the value of the 'attributes' field.
*/
public java.util.Map getAttributes() {
return attributes;
}
/**
* Sets the value of the 'attributes' field.
* @param value the value to set.
*/
public void setAttributes(java.util.Map value) {
this.attributes = value;
}
/** Creates a new OntologyTermAnnotation RecordBuilder */
public static org.opencb.biodata.models.variant.avro.OntologyTermAnnotation.Builder newBuilder() {
return new org.opencb.biodata.models.variant.avro.OntologyTermAnnotation.Builder();
}
/** Creates a new OntologyTermAnnotation RecordBuilder by copying an existing Builder */
public static org.opencb.biodata.models.variant.avro.OntologyTermAnnotation.Builder newBuilder(org.opencb.biodata.models.variant.avro.OntologyTermAnnotation.Builder other) {
return new org.opencb.biodata.models.variant.avro.OntologyTermAnnotation.Builder(other);
}
/** Creates a new OntologyTermAnnotation RecordBuilder by copying an existing OntologyTermAnnotation instance */
public static org.opencb.biodata.models.variant.avro.OntologyTermAnnotation.Builder newBuilder(org.opencb.biodata.models.variant.avro.OntologyTermAnnotation other) {
return new org.opencb.biodata.models.variant.avro.OntologyTermAnnotation.Builder(other);
}
/**
* RecordBuilder for OntologyTermAnnotation instances.
*/
public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase
implements org.apache.avro.data.RecordBuilder {
private java.lang.String id;
private java.lang.String name;
private java.lang.String description;
private java.lang.String source;
private java.lang.String url;
private java.util.Map attributes;
/** Creates a new Builder */
private Builder() {
super(org.opencb.biodata.models.variant.avro.OntologyTermAnnotation.SCHEMA$);
}
/** Creates a Builder by copying an existing Builder */
private Builder(org.opencb.biodata.models.variant.avro.OntologyTermAnnotation.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.name)) {
this.name = data().deepCopy(fields()[1].schema(), other.name);
fieldSetFlags()[1] = true;
}
if (isValidValue(fields()[2], other.description)) {
this.description = data().deepCopy(fields()[2].schema(), other.description);
fieldSetFlags()[2] = true;
}
if (isValidValue(fields()[3], other.source)) {
this.source = data().deepCopy(fields()[3].schema(), other.source);
fieldSetFlags()[3] = true;
}
if (isValidValue(fields()[4], other.url)) {
this.url = data().deepCopy(fields()[4].schema(), other.url);
fieldSetFlags()[4] = true;
}
if (isValidValue(fields()[5], other.attributes)) {
this.attributes = data().deepCopy(fields()[5].schema(), other.attributes);
fieldSetFlags()[5] = true;
}
}
/** Creates a Builder by copying an existing OntologyTermAnnotation instance */
private Builder(org.opencb.biodata.models.variant.avro.OntologyTermAnnotation other) {
super(org.opencb.biodata.models.variant.avro.OntologyTermAnnotation.SCHEMA$);
if (isValidValue(fields()[0], other.id)) {
this.id = data().deepCopy(fields()[0].schema(), other.id);
fieldSetFlags()[0] = true;
}
if (isValidValue(fields()[1], other.name)) {
this.name = data().deepCopy(fields()[1].schema(), other.name);
fieldSetFlags()[1] = true;
}
if (isValidValue(fields()[2], other.description)) {
this.description = data().deepCopy(fields()[2].schema(), other.description);
fieldSetFlags()[2] = true;
}
if (isValidValue(fields()[3], other.source)) {
this.source = data().deepCopy(fields()[3].schema(), other.source);
fieldSetFlags()[3] = true;
}
if (isValidValue(fields()[4], other.url)) {
this.url = data().deepCopy(fields()[4].schema(), other.url);
fieldSetFlags()[4] = true;
}
if (isValidValue(fields()[5], other.attributes)) {
this.attributes = data().deepCopy(fields()[5].schema(), other.attributes);
fieldSetFlags()[5] = true;
}
}
/** Gets the value of the 'id' field */
public java.lang.String getId() {
return id;
}
/** Sets the value of the 'id' field */
public org.opencb.biodata.models.variant.avro.OntologyTermAnnotation.Builder setId(java.lang.String 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.opencb.biodata.models.variant.avro.OntologyTermAnnotation.Builder clearId() {
id = null;
fieldSetFlags()[0] = false;
return this;
}
/** Gets the value of the 'name' field */
public java.lang.String getName() {
return name;
}
/** Sets the value of the 'name' field */
public org.opencb.biodata.models.variant.avro.OntologyTermAnnotation.Builder setName(java.lang.String value) {
validate(fields()[1], value);
this.name = value;
fieldSetFlags()[1] = true;
return this;
}
/** Checks whether the 'name' field has been set */
public boolean hasName() {
return fieldSetFlags()[1];
}
/** Clears the value of the 'name' field */
public org.opencb.biodata.models.variant.avro.OntologyTermAnnotation.Builder clearName() {
name = null;
fieldSetFlags()[1] = false;
return this;
}
/** Gets the value of the 'description' field */
public java.lang.String getDescription() {
return description;
}
/** Sets the value of the 'description' field */
public org.opencb.biodata.models.variant.avro.OntologyTermAnnotation.Builder setDescription(java.lang.String value) {
validate(fields()[2], value);
this.description = value;
fieldSetFlags()[2] = true;
return this;
}
/** Checks whether the 'description' field has been set */
public boolean hasDescription() {
return fieldSetFlags()[2];
}
/** Clears the value of the 'description' field */
public org.opencb.biodata.models.variant.avro.OntologyTermAnnotation.Builder clearDescription() {
description = null;
fieldSetFlags()[2] = false;
return this;
}
/** Gets the value of the 'source' field */
public java.lang.String getSource() {
return source;
}
/** Sets the value of the 'source' field */
public org.opencb.biodata.models.variant.avro.OntologyTermAnnotation.Builder setSource(java.lang.String value) {
validate(fields()[3], value);
this.source = value;
fieldSetFlags()[3] = true;
return this;
}
/** Checks whether the 'source' field has been set */
public boolean hasSource() {
return fieldSetFlags()[3];
}
/** Clears the value of the 'source' field */
public org.opencb.biodata.models.variant.avro.OntologyTermAnnotation.Builder clearSource() {
source = null;
fieldSetFlags()[3] = false;
return this;
}
/** Gets the value of the 'url' field */
public java.lang.String getUrl() {
return url;
}
/** Sets the value of the 'url' field */
public org.opencb.biodata.models.variant.avro.OntologyTermAnnotation.Builder setUrl(java.lang.String value) {
validate(fields()[4], value);
this.url = value;
fieldSetFlags()[4] = true;
return this;
}
/** Checks whether the 'url' field has been set */
public boolean hasUrl() {
return fieldSetFlags()[4];
}
/** Clears the value of the 'url' field */
public org.opencb.biodata.models.variant.avro.OntologyTermAnnotation.Builder clearUrl() {
url = null;
fieldSetFlags()[4] = false;
return this;
}
/** Gets the value of the 'attributes' field */
public java.util.Map getAttributes() {
return attributes;
}
/** Sets the value of the 'attributes' field */
public org.opencb.biodata.models.variant.avro.OntologyTermAnnotation.Builder setAttributes(java.util.Map value) {
validate(fields()[5], value);
this.attributes = value;
fieldSetFlags()[5] = true;
return this;
}
/** Checks whether the 'attributes' field has been set */
public boolean hasAttributes() {
return fieldSetFlags()[5];
}
/** Clears the value of the 'attributes' field */
public org.opencb.biodata.models.variant.avro.OntologyTermAnnotation.Builder clearAttributes() {
attributes = null;
fieldSetFlags()[5] = false;
return this;
}
@Override
public OntologyTermAnnotation build() {
try {
OntologyTermAnnotation record = new OntologyTermAnnotation();
record.id = fieldSetFlags()[0] ? this.id : (java.lang.String) defaultValue(fields()[0]);
record.name = fieldSetFlags()[1] ? this.name : (java.lang.String) defaultValue(fields()[1]);
record.description = fieldSetFlags()[2] ? this.description : (java.lang.String) defaultValue(fields()[2]);
record.source = fieldSetFlags()[3] ? this.source : (java.lang.String) defaultValue(fields()[3]);
record.url = fieldSetFlags()[4] ? this.url : (java.lang.String) defaultValue(fields()[4]);
record.attributes = fieldSetFlags()[5] ? this.attributes : (java.util.Map) defaultValue(fields()[5]);
return record;
} catch (Exception e) {
throw new org.apache.avro.AvroRuntimeException(e);
}
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy