
org.radarcns.connector.upload.altoida.AltoidaAssessmentsSummary Maven / Gradle / Ivy
The newest version!
/**
* Autogenerated by Avro
*
* DO NOT EDIT DIRECTLY
*/
package org.radarcns.connector.upload.altoida;
import org.apache.avro.generic.GenericArray;
import org.apache.avro.specific.SpecificData;
import org.apache.avro.util.Utf8;
import org.apache.avro.message.BinaryMessageEncoder;
import org.apache.avro.message.BinaryMessageDecoder;
import org.apache.avro.message.SchemaStore;
/** Summary timestamps of a completed Altoida assessment. */
@org.apache.avro.specific.AvroGenerated
public class AltoidaAssessmentsSummary extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord {
private static final long serialVersionUID = -6952830185437847378L;
public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"AltoidaAssessmentsSummary\",\"namespace\":\"org.radarcns.connector.upload.altoida\",\"doc\":\"Summary timestamps of a completed Altoida assessment.\",\"fields\":[{\"name\":\"timeReceived\",\"type\":\"double\",\"doc\":\"Timestamp in unix time received from Altoida API.\"},{\"name\":\"assessmentName\",\"type\":[\"null\",{\"type\":\"string\",\"avro.java.string\":\"String\"}],\"doc\":\"Assessment name.\",\"default\":null},{\"name\":\"startTime\",\"type\":\"double\",\"doc\":\"Timestamp in UTC (s) when the assessment is started.\"},{\"name\":\"endTime\",\"type\":\"double\",\"doc\":\"Timestamp in UTC (s) when the assessment is finished.\"},{\"name\":\"metadata\",\"type\":[\"null\",{\"type\":\"string\",\"avro.java.string\":\"String\"}],\"doc\":\"Assessment metadata, if provided.\",\"default\":null}]}");
public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; }
private static final SpecificData MODEL$ = new SpecificData();
private static final BinaryMessageEncoder ENCODER =
new BinaryMessageEncoder<>(MODEL$, SCHEMA$);
private static final BinaryMessageDecoder DECODER =
new BinaryMessageDecoder<>(MODEL$, SCHEMA$);
/**
* Return the BinaryMessageEncoder instance used by this class.
* @return the message encoder used by this class
*/
public static BinaryMessageEncoder getEncoder() {
return ENCODER;
}
/**
* Return the BinaryMessageDecoder instance used by this class.
* @return the message decoder used by this class
*/
public static BinaryMessageDecoder getDecoder() {
return DECODER;
}
/**
* Create a new BinaryMessageDecoder instance for this class that uses the specified {@link SchemaStore}.
* @param resolver a {@link SchemaStore} used to find schemas by fingerprint
* @return a BinaryMessageDecoder instance for this class backed by the given SchemaStore
*/
public static BinaryMessageDecoder createDecoder(SchemaStore resolver) {
return new BinaryMessageDecoder<>(MODEL$, SCHEMA$, resolver);
}
/**
* Serializes this AltoidaAssessmentsSummary to a ByteBuffer.
* @return a buffer holding the serialized data for this instance
* @throws java.io.IOException if this instance could not be serialized
*/
public java.nio.ByteBuffer toByteBuffer() throws java.io.IOException {
return ENCODER.encode(this);
}
/**
* Deserializes a AltoidaAssessmentsSummary from a ByteBuffer.
* @param b a byte buffer holding serialized data for an instance of this class
* @return a AltoidaAssessmentsSummary instance decoded from the given buffer
* @throws java.io.IOException if the given bytes could not be deserialized into an instance of this class
*/
public static AltoidaAssessmentsSummary fromByteBuffer(
java.nio.ByteBuffer b) throws java.io.IOException {
return DECODER.decode(b);
}
/** Timestamp in unix time received from Altoida API. */
private double timeReceived;
/** Assessment name. */
private java.lang.String assessmentName;
/** Timestamp in UTC (s) when the assessment is started. */
private double startTime;
/** Timestamp in UTC (s) when the assessment is finished. */
private double endTime;
/** Assessment metadata, if provided. */
private java.lang.String metadata;
/**
* 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 AltoidaAssessmentsSummary() {}
/**
* All-args constructor.
* @param timeReceived Timestamp in unix time received from Altoida API.
* @param assessmentName Assessment name.
* @param startTime Timestamp in UTC (s) when the assessment is started.
* @param endTime Timestamp in UTC (s) when the assessment is finished.
* @param metadata Assessment metadata, if provided.
*/
public AltoidaAssessmentsSummary(java.lang.Double timeReceived, java.lang.String assessmentName, java.lang.Double startTime, java.lang.Double endTime, java.lang.String metadata) {
this.timeReceived = timeReceived;
this.assessmentName = assessmentName;
this.startTime = startTime;
this.endTime = endTime;
this.metadata = metadata;
}
@Override
public org.apache.avro.specific.SpecificData getSpecificData() { return MODEL$; }
@Override
public org.apache.avro.Schema getSchema() { return SCHEMA$; }
// Used by DatumWriter. Applications should not call.
@Override
public java.lang.Object get(int field$) {
switch (field$) {
case 0: return timeReceived;
case 1: return assessmentName;
case 2: return startTime;
case 3: return endTime;
case 4: return metadata;
default: throw new IndexOutOfBoundsException("Invalid index: " + field$);
}
}
// Used by DatumReader. Applications should not call.
@Override
@SuppressWarnings(value="unchecked")
public void put(int field$, java.lang.Object value$) {
switch (field$) {
case 0: timeReceived = (java.lang.Double)value$; break;
case 1: assessmentName = value$ != null ? value$.toString() : null; break;
case 2: startTime = (java.lang.Double)value$; break;
case 3: endTime = (java.lang.Double)value$; break;
case 4: metadata = value$ != null ? value$.toString() : null; break;
default: throw new IndexOutOfBoundsException("Invalid index: " + field$);
}
}
/**
* Gets the value of the 'timeReceived' field.
* @return Timestamp in unix time received from Altoida API.
*/
public double getTimeReceived() {
return timeReceived;
}
/**
* Sets the value of the 'timeReceived' field.
* Timestamp in unix time received from Altoida API.
* @param value the value to set.
*/
public void setTimeReceived(double value) {
this.timeReceived = value;
}
/**
* Gets the value of the 'assessmentName' field.
* @return Assessment name.
*/
public java.lang.String getAssessmentName() {
return assessmentName;
}
/**
* Sets the value of the 'assessmentName' field.
* Assessment name.
* @param value the value to set.
*/
public void setAssessmentName(java.lang.String value) {
this.assessmentName = value;
}
/**
* Gets the value of the 'startTime' field.
* @return Timestamp in UTC (s) when the assessment is started.
*/
public double getStartTime() {
return startTime;
}
/**
* Sets the value of the 'startTime' field.
* Timestamp in UTC (s) when the assessment is started.
* @param value the value to set.
*/
public void setStartTime(double value) {
this.startTime = value;
}
/**
* Gets the value of the 'endTime' field.
* @return Timestamp in UTC (s) when the assessment is finished.
*/
public double getEndTime() {
return endTime;
}
/**
* Sets the value of the 'endTime' field.
* Timestamp in UTC (s) when the assessment is finished.
* @param value the value to set.
*/
public void setEndTime(double value) {
this.endTime = value;
}
/**
* Gets the value of the 'metadata' field.
* @return Assessment metadata, if provided.
*/
public java.lang.String getMetadata() {
return metadata;
}
/**
* Sets the value of the 'metadata' field.
* Assessment metadata, if provided.
* @param value the value to set.
*/
public void setMetadata(java.lang.String value) {
this.metadata = value;
}
/**
* Creates a new AltoidaAssessmentsSummary RecordBuilder.
* @return A new AltoidaAssessmentsSummary RecordBuilder
*/
public static org.radarcns.connector.upload.altoida.AltoidaAssessmentsSummary.Builder newBuilder() {
return new org.radarcns.connector.upload.altoida.AltoidaAssessmentsSummary.Builder();
}
/**
* Creates a new AltoidaAssessmentsSummary RecordBuilder by copying an existing Builder.
* @param other The existing builder to copy.
* @return A new AltoidaAssessmentsSummary RecordBuilder
*/
public static org.radarcns.connector.upload.altoida.AltoidaAssessmentsSummary.Builder newBuilder(org.radarcns.connector.upload.altoida.AltoidaAssessmentsSummary.Builder other) {
if (other == null) {
return new org.radarcns.connector.upload.altoida.AltoidaAssessmentsSummary.Builder();
} else {
return new org.radarcns.connector.upload.altoida.AltoidaAssessmentsSummary.Builder(other);
}
}
/**
* Creates a new AltoidaAssessmentsSummary RecordBuilder by copying an existing AltoidaAssessmentsSummary instance.
* @param other The existing instance to copy.
* @return A new AltoidaAssessmentsSummary RecordBuilder
*/
public static org.radarcns.connector.upload.altoida.AltoidaAssessmentsSummary.Builder newBuilder(org.radarcns.connector.upload.altoida.AltoidaAssessmentsSummary other) {
if (other == null) {
return new org.radarcns.connector.upload.altoida.AltoidaAssessmentsSummary.Builder();
} else {
return new org.radarcns.connector.upload.altoida.AltoidaAssessmentsSummary.Builder(other);
}
}
/**
* RecordBuilder for AltoidaAssessmentsSummary instances.
*/
@org.apache.avro.specific.AvroGenerated
public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase
implements org.apache.avro.data.RecordBuilder {
/** Timestamp in unix time received from Altoida API. */
private double timeReceived;
/** Assessment name. */
private java.lang.String assessmentName;
/** Timestamp in UTC (s) when the assessment is started. */
private double startTime;
/** Timestamp in UTC (s) when the assessment is finished. */
private double endTime;
/** Assessment metadata, if provided. */
private java.lang.String metadata;
/** Creates a new Builder */
private Builder() {
super(SCHEMA$, MODEL$);
}
/**
* Creates a Builder by copying an existing Builder.
* @param other The existing Builder to copy.
*/
private Builder(org.radarcns.connector.upload.altoida.AltoidaAssessmentsSummary.Builder other) {
super(other);
if (isValidValue(fields()[0], other.timeReceived)) {
this.timeReceived = data().deepCopy(fields()[0].schema(), other.timeReceived);
fieldSetFlags()[0] = other.fieldSetFlags()[0];
}
if (isValidValue(fields()[1], other.assessmentName)) {
this.assessmentName = data().deepCopy(fields()[1].schema(), other.assessmentName);
fieldSetFlags()[1] = other.fieldSetFlags()[1];
}
if (isValidValue(fields()[2], other.startTime)) {
this.startTime = data().deepCopy(fields()[2].schema(), other.startTime);
fieldSetFlags()[2] = other.fieldSetFlags()[2];
}
if (isValidValue(fields()[3], other.endTime)) {
this.endTime = data().deepCopy(fields()[3].schema(), other.endTime);
fieldSetFlags()[3] = other.fieldSetFlags()[3];
}
if (isValidValue(fields()[4], other.metadata)) {
this.metadata = data().deepCopy(fields()[4].schema(), other.metadata);
fieldSetFlags()[4] = other.fieldSetFlags()[4];
}
}
/**
* Creates a Builder by copying an existing AltoidaAssessmentsSummary instance
* @param other The existing instance to copy.
*/
private Builder(org.radarcns.connector.upload.altoida.AltoidaAssessmentsSummary other) {
super(SCHEMA$, MODEL$);
if (isValidValue(fields()[0], other.timeReceived)) {
this.timeReceived = data().deepCopy(fields()[0].schema(), other.timeReceived);
fieldSetFlags()[0] = true;
}
if (isValidValue(fields()[1], other.assessmentName)) {
this.assessmentName = data().deepCopy(fields()[1].schema(), other.assessmentName);
fieldSetFlags()[1] = true;
}
if (isValidValue(fields()[2], other.startTime)) {
this.startTime = data().deepCopy(fields()[2].schema(), other.startTime);
fieldSetFlags()[2] = true;
}
if (isValidValue(fields()[3], other.endTime)) {
this.endTime = data().deepCopy(fields()[3].schema(), other.endTime);
fieldSetFlags()[3] = true;
}
if (isValidValue(fields()[4], other.metadata)) {
this.metadata = data().deepCopy(fields()[4].schema(), other.metadata);
fieldSetFlags()[4] = true;
}
}
/**
* Gets the value of the 'timeReceived' field.
* Timestamp in unix time received from Altoida API.
* @return The value.
*/
public double getTimeReceived() {
return timeReceived;
}
/**
* Sets the value of the 'timeReceived' field.
* Timestamp in unix time received from Altoida API.
* @param value The value of 'timeReceived'.
* @return This builder.
*/
public org.radarcns.connector.upload.altoida.AltoidaAssessmentsSummary.Builder setTimeReceived(double value) {
validate(fields()[0], value);
this.timeReceived = value;
fieldSetFlags()[0] = true;
return this;
}
/**
* Checks whether the 'timeReceived' field has been set.
* Timestamp in unix time received from Altoida API.
* @return True if the 'timeReceived' field has been set, false otherwise.
*/
public boolean hasTimeReceived() {
return fieldSetFlags()[0];
}
/**
* Clears the value of the 'timeReceived' field.
* Timestamp in unix time received from Altoida API.
* @return This builder.
*/
public org.radarcns.connector.upload.altoida.AltoidaAssessmentsSummary.Builder clearTimeReceived() {
fieldSetFlags()[0] = false;
return this;
}
/**
* Gets the value of the 'assessmentName' field.
* Assessment name.
* @return The value.
*/
public java.lang.String getAssessmentName() {
return assessmentName;
}
/**
* Sets the value of the 'assessmentName' field.
* Assessment name.
* @param value The value of 'assessmentName'.
* @return This builder.
*/
public org.radarcns.connector.upload.altoida.AltoidaAssessmentsSummary.Builder setAssessmentName(java.lang.String value) {
validate(fields()[1], value);
this.assessmentName = value;
fieldSetFlags()[1] = true;
return this;
}
/**
* Checks whether the 'assessmentName' field has been set.
* Assessment name.
* @return True if the 'assessmentName' field has been set, false otherwise.
*/
public boolean hasAssessmentName() {
return fieldSetFlags()[1];
}
/**
* Clears the value of the 'assessmentName' field.
* Assessment name.
* @return This builder.
*/
public org.radarcns.connector.upload.altoida.AltoidaAssessmentsSummary.Builder clearAssessmentName() {
assessmentName = null;
fieldSetFlags()[1] = false;
return this;
}
/**
* Gets the value of the 'startTime' field.
* Timestamp in UTC (s) when the assessment is started.
* @return The value.
*/
public double getStartTime() {
return startTime;
}
/**
* Sets the value of the 'startTime' field.
* Timestamp in UTC (s) when the assessment is started.
* @param value The value of 'startTime'.
* @return This builder.
*/
public org.radarcns.connector.upload.altoida.AltoidaAssessmentsSummary.Builder setStartTime(double value) {
validate(fields()[2], value);
this.startTime = value;
fieldSetFlags()[2] = true;
return this;
}
/**
* Checks whether the 'startTime' field has been set.
* Timestamp in UTC (s) when the assessment is started.
* @return True if the 'startTime' field has been set, false otherwise.
*/
public boolean hasStartTime() {
return fieldSetFlags()[2];
}
/**
* Clears the value of the 'startTime' field.
* Timestamp in UTC (s) when the assessment is started.
* @return This builder.
*/
public org.radarcns.connector.upload.altoida.AltoidaAssessmentsSummary.Builder clearStartTime() {
fieldSetFlags()[2] = false;
return this;
}
/**
* Gets the value of the 'endTime' field.
* Timestamp in UTC (s) when the assessment is finished.
* @return The value.
*/
public double getEndTime() {
return endTime;
}
/**
* Sets the value of the 'endTime' field.
* Timestamp in UTC (s) when the assessment is finished.
* @param value The value of 'endTime'.
* @return This builder.
*/
public org.radarcns.connector.upload.altoida.AltoidaAssessmentsSummary.Builder setEndTime(double value) {
validate(fields()[3], value);
this.endTime = value;
fieldSetFlags()[3] = true;
return this;
}
/**
* Checks whether the 'endTime' field has been set.
* Timestamp in UTC (s) when the assessment is finished.
* @return True if the 'endTime' field has been set, false otherwise.
*/
public boolean hasEndTime() {
return fieldSetFlags()[3];
}
/**
* Clears the value of the 'endTime' field.
* Timestamp in UTC (s) when the assessment is finished.
* @return This builder.
*/
public org.radarcns.connector.upload.altoida.AltoidaAssessmentsSummary.Builder clearEndTime() {
fieldSetFlags()[3] = false;
return this;
}
/**
* Gets the value of the 'metadata' field.
* Assessment metadata, if provided.
* @return The value.
*/
public java.lang.String getMetadata() {
return metadata;
}
/**
* Sets the value of the 'metadata' field.
* Assessment metadata, if provided.
* @param value The value of 'metadata'.
* @return This builder.
*/
public org.radarcns.connector.upload.altoida.AltoidaAssessmentsSummary.Builder setMetadata(java.lang.String value) {
validate(fields()[4], value);
this.metadata = value;
fieldSetFlags()[4] = true;
return this;
}
/**
* Checks whether the 'metadata' field has been set.
* Assessment metadata, if provided.
* @return True if the 'metadata' field has been set, false otherwise.
*/
public boolean hasMetadata() {
return fieldSetFlags()[4];
}
/**
* Clears the value of the 'metadata' field.
* Assessment metadata, if provided.
* @return This builder.
*/
public org.radarcns.connector.upload.altoida.AltoidaAssessmentsSummary.Builder clearMetadata() {
metadata = null;
fieldSetFlags()[4] = false;
return this;
}
@Override
@SuppressWarnings("unchecked")
public AltoidaAssessmentsSummary build() {
try {
AltoidaAssessmentsSummary record = new AltoidaAssessmentsSummary();
record.timeReceived = fieldSetFlags()[0] ? this.timeReceived : (java.lang.Double) defaultValue(fields()[0]);
record.assessmentName = fieldSetFlags()[1] ? this.assessmentName : (java.lang.String) defaultValue(fields()[1]);
record.startTime = fieldSetFlags()[2] ? this.startTime : (java.lang.Double) defaultValue(fields()[2]);
record.endTime = fieldSetFlags()[3] ? this.endTime : (java.lang.Double) defaultValue(fields()[3]);
record.metadata = fieldSetFlags()[4] ? this.metadata : (java.lang.String) defaultValue(fields()[4]);
return record;
} catch (org.apache.avro.AvroMissingFieldException e) {
throw e;
} catch (java.lang.Exception e) {
throw new org.apache.avro.AvroRuntimeException(e);
}
}
}
@SuppressWarnings("unchecked")
private static final org.apache.avro.io.DatumWriter
WRITER$ = (org.apache.avro.io.DatumWriter)MODEL$.createDatumWriter(SCHEMA$);
@Override public void writeExternal(java.io.ObjectOutput out)
throws java.io.IOException {
WRITER$.write(this, SpecificData.getEncoder(out));
}
@SuppressWarnings("unchecked")
private static final org.apache.avro.io.DatumReader
READER$ = (org.apache.avro.io.DatumReader)MODEL$.createDatumReader(SCHEMA$);
@Override public void readExternal(java.io.ObjectInput in)
throws java.io.IOException {
READER$.read(this, SpecificData.getDecoder(in));
}
@Override protected boolean hasCustomCoders() { return true; }
@Override public void customEncode(org.apache.avro.io.Encoder out)
throws java.io.IOException
{
out.writeDouble(this.timeReceived);
if (this.assessmentName == null) {
out.writeIndex(0);
out.writeNull();
} else {
out.writeIndex(1);
out.writeString(this.assessmentName);
}
out.writeDouble(this.startTime);
out.writeDouble(this.endTime);
if (this.metadata == null) {
out.writeIndex(0);
out.writeNull();
} else {
out.writeIndex(1);
out.writeString(this.metadata);
}
}
@Override public void customDecode(org.apache.avro.io.ResolvingDecoder in)
throws java.io.IOException
{
org.apache.avro.Schema.Field[] fieldOrder = in.readFieldOrderIfDiff();
if (fieldOrder == null) {
this.timeReceived = in.readDouble();
if (in.readIndex() != 1) {
in.readNull();
this.assessmentName = null;
} else {
this.assessmentName = in.readString();
}
this.startTime = in.readDouble();
this.endTime = in.readDouble();
if (in.readIndex() != 1) {
in.readNull();
this.metadata = null;
} else {
this.metadata = in.readString();
}
} else {
for (int i = 0; i < 5; i++) {
switch (fieldOrder[i].pos()) {
case 0:
this.timeReceived = in.readDouble();
break;
case 1:
if (in.readIndex() != 1) {
in.readNull();
this.assessmentName = null;
} else {
this.assessmentName = in.readString();
}
break;
case 2:
this.startTime = in.readDouble();
break;
case 3:
this.endTime = in.readDouble();
break;
case 4:
if (in.readIndex() != 1) {
in.readNull();
this.metadata = null;
} else {
this.metadata = in.readString();
}
break;
default:
throw new java.io.IOException("Corrupt ResolvingDecoder.");
}
}
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy