org.gel.models.report.avro.ConfidenceInterval Maven / Gradle / Ivy
/**
* Autogenerated by Avro
*
* DO NOT EDIT DIRECTLY
*/
package org.gel.models.report.avro;
@SuppressWarnings("all")
@org.apache.avro.specific.AvroGenerated
public class ConfidenceInterval 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\":\"ConfidenceInterval\",\"namespace\":\"org.gel.models.report.avro\",\"fields\":[{\"name\":\"left\",\"type\":\"int\"},{\"name\":\"right\",\"type\":\"int\"}]}");
public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; }
private int left;
private int right;
/**
* 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 ConfidenceInterval() {}
/**
* All-args constructor.
*/
public ConfidenceInterval(java.lang.Integer left, java.lang.Integer right) {
this.left = left;
this.right = right;
}
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 left;
case 1: return right;
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: left = (java.lang.Integer)value$; break;
case 1: right = (java.lang.Integer)value$; break;
default: throw new org.apache.avro.AvroRuntimeException("Bad index");
}
}
/**
* Gets the value of the 'left' field.
*/
public java.lang.Integer getLeft() {
return left;
}
/**
* Sets the value of the 'left' field.
* @param value the value to set.
*/
public void setLeft(java.lang.Integer value) {
this.left = value;
}
/**
* Gets the value of the 'right' field.
*/
public java.lang.Integer getRight() {
return right;
}
/**
* Sets the value of the 'right' field.
* @param value the value to set.
*/
public void setRight(java.lang.Integer value) {
this.right = value;
}
/** Creates a new ConfidenceInterval RecordBuilder */
public static org.gel.models.report.avro.ConfidenceInterval.Builder newBuilder() {
return new org.gel.models.report.avro.ConfidenceInterval.Builder();
}
/** Creates a new ConfidenceInterval RecordBuilder by copying an existing Builder */
public static org.gel.models.report.avro.ConfidenceInterval.Builder newBuilder(org.gel.models.report.avro.ConfidenceInterval.Builder other) {
return new org.gel.models.report.avro.ConfidenceInterval.Builder(other);
}
/** Creates a new ConfidenceInterval RecordBuilder by copying an existing ConfidenceInterval instance */
public static org.gel.models.report.avro.ConfidenceInterval.Builder newBuilder(org.gel.models.report.avro.ConfidenceInterval other) {
return new org.gel.models.report.avro.ConfidenceInterval.Builder(other);
}
/**
* RecordBuilder for ConfidenceInterval instances.
*/
public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase
implements org.apache.avro.data.RecordBuilder {
private int left;
private int right;
/** Creates a new Builder */
private Builder() {
super(org.gel.models.report.avro.ConfidenceInterval.SCHEMA$);
}
/** Creates a Builder by copying an existing Builder */
private Builder(org.gel.models.report.avro.ConfidenceInterval.Builder other) {
super(other);
if (isValidValue(fields()[0], other.left)) {
this.left = data().deepCopy(fields()[0].schema(), other.left);
fieldSetFlags()[0] = true;
}
if (isValidValue(fields()[1], other.right)) {
this.right = data().deepCopy(fields()[1].schema(), other.right);
fieldSetFlags()[1] = true;
}
}
/** Creates a Builder by copying an existing ConfidenceInterval instance */
private Builder(org.gel.models.report.avro.ConfidenceInterval other) {
super(org.gel.models.report.avro.ConfidenceInterval.SCHEMA$);
if (isValidValue(fields()[0], other.left)) {
this.left = data().deepCopy(fields()[0].schema(), other.left);
fieldSetFlags()[0] = true;
}
if (isValidValue(fields()[1], other.right)) {
this.right = data().deepCopy(fields()[1].schema(), other.right);
fieldSetFlags()[1] = true;
}
}
/** Gets the value of the 'left' field */
public java.lang.Integer getLeft() {
return left;
}
/** Sets the value of the 'left' field */
public org.gel.models.report.avro.ConfidenceInterval.Builder setLeft(int value) {
validate(fields()[0], value);
this.left = value;
fieldSetFlags()[0] = true;
return this;
}
/** Checks whether the 'left' field has been set */
public boolean hasLeft() {
return fieldSetFlags()[0];
}
/** Clears the value of the 'left' field */
public org.gel.models.report.avro.ConfidenceInterval.Builder clearLeft() {
fieldSetFlags()[0] = false;
return this;
}
/** Gets the value of the 'right' field */
public java.lang.Integer getRight() {
return right;
}
/** Sets the value of the 'right' field */
public org.gel.models.report.avro.ConfidenceInterval.Builder setRight(int value) {
validate(fields()[1], value);
this.right = value;
fieldSetFlags()[1] = true;
return this;
}
/** Checks whether the 'right' field has been set */
public boolean hasRight() {
return fieldSetFlags()[1];
}
/** Clears the value of the 'right' field */
public org.gel.models.report.avro.ConfidenceInterval.Builder clearRight() {
fieldSetFlags()[1] = false;
return this;
}
@Override
public ConfidenceInterval build() {
try {
ConfidenceInterval record = new ConfidenceInterval();
record.left = fieldSetFlags()[0] ? this.left : (java.lang.Integer) defaultValue(fields()[0]);
record.right = fieldSetFlags()[1] ? this.right : (java.lang.Integer) defaultValue(fields()[1]);
return record;
} catch (Exception e) {
throw new org.apache.avro.AvroRuntimeException(e);
}
}
}
}