/** * Autogenerated by Avro * * DO NOT EDIT DIRECTLY */ package org.kaaproject.kaa.common.endpoint.gen; @SuppressWarnings("all") @org.apache.avro.specific.AvroGenerated public class SyncRequestMetaData 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\":\"SyncRequestMetaData\",\"namespace\":\"org.kaaproject.kaa.common.endpoint.gen\",\"fields\":[{\"name\":\"sdkToken\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"endpointPublicKeyHash\",\"type\":[\"bytes\",\"null\"]},{\"name\":\"profileHash\",\"type\":[\"bytes\",\"null\"]},{\"name\":\"timeout\",\"type\":[\"long\",\"null\"]}],\"direction\":\"out\"}"); private java.lang.String sdkToken; private java.nio.ByteBuffer endpointPublicKeyHash; private java.nio.ByteBuffer profileHash; private java.lang.Long timeout; /** * 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 SyncRequestMetaData() { } /** * All-args constructor. */ public SyncRequestMetaData(java.lang.String sdkToken, java.nio.ByteBuffer endpointPublicKeyHash, java.nio.ByteBuffer profileHash, java.lang.Long timeout) { this.sdkToken = sdkToken; this.endpointPublicKeyHash = endpointPublicKeyHash; this.profileHash = profileHash; this.timeout = timeout; } public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; } /** * Creates a new SyncRequestMetaData RecordBuilder */ public static org.kaaproject.kaa.common.endpoint.gen.SyncRequestMetaData.Builder newBuilder() { return new org.kaaproject.kaa.common.endpoint.gen.SyncRequestMetaData.Builder(); } /** * Creates a new SyncRequestMetaData RecordBuilder by copying an existing Builder */ public static org.kaaproject.kaa.common.endpoint.gen.SyncRequestMetaData.Builder newBuilder(org.kaaproject.kaa.common.endpoint.gen.SyncRequestMetaData.Builder other) { return new org.kaaproject.kaa.common.endpoint.gen.SyncRequestMetaData.Builder(other); } /** * Creates a new SyncRequestMetaData RecordBuilder by copying an existing SyncRequestMetaData * instance */ public static org.kaaproject.kaa.common.endpoint.gen.SyncRequestMetaData.Builder newBuilder(org.kaaproject.kaa.common.endpoint.gen.SyncRequestMetaData other) { return new org.kaaproject.kaa.common.endpoint.gen.SyncRequestMetaData.Builder(other); } 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 sdkToken; case 1: return endpointPublicKeyHash; case 2: return profileHash; case 3: return timeout; 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: sdkToken = (java.lang.String) value$; break; case 1: endpointPublicKeyHash = (java.nio.ByteBuffer) value$; break; case 2: profileHash = (java.nio.ByteBuffer) value$; break; case 3: timeout = (java.lang.Long) value$; break; default: throw new org.apache.avro.AvroRuntimeException("Bad index"); } } /** * Gets the value of the 'sdkToken' field. */ public java.lang.String getSdkToken() { return sdkToken; } /** * Sets the value of the 'sdkToken' field. * * @param value the value to set. */ public void setSdkToken(java.lang.String value) { this.sdkToken = value; } /** * Gets the value of the 'endpointPublicKeyHash' field. */ public java.nio.ByteBuffer getEndpointPublicKeyHash() { return endpointPublicKeyHash; } /** * Sets the value of the 'endpointPublicKeyHash' field. * * @param value the value to set. */ public void setEndpointPublicKeyHash(java.nio.ByteBuffer value) { this.endpointPublicKeyHash = value; } /** * Gets the value of the 'profileHash' field. */ public java.nio.ByteBuffer getProfileHash() { return profileHash; } /** * Sets the value of the 'profileHash' field. * * @param value the value to set. */ public void setProfileHash(java.nio.ByteBuffer value) { this.profileHash = value; } /** * Gets the value of the 'timeout' field. */ public java.lang.Long getTimeout() { return timeout; } /** * Sets the value of the 'timeout' field. * * @param value the value to set. */ public void setTimeout(java.lang.Long value) { this.timeout = value; } /** * RecordBuilder for SyncRequestMetaData instances. */ public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<SyncRequestMetaData> implements org.apache.avro.data.RecordBuilder<SyncRequestMetaData> { private java.lang.String sdkToken; private java.nio.ByteBuffer endpointPublicKeyHash; private java.nio.ByteBuffer profileHash; private java.lang.Long timeout; /** * Creates a new Builder */ private Builder() { super(org.kaaproject.kaa.common.endpoint.gen.SyncRequestMetaData.SCHEMA$); } /** * Creates a Builder by copying an existing Builder */ private Builder(org.kaaproject.kaa.common.endpoint.gen.SyncRequestMetaData.Builder other) { super(other); if (isValidValue(fields()[0], other.sdkToken)) { this.sdkToken = data().deepCopy(fields()[0].schema(), other.sdkToken); fieldSetFlags()[0] = true; } if (isValidValue(fields()[1], other.endpointPublicKeyHash)) { this.endpointPublicKeyHash = data().deepCopy(fields()[1].schema(), other.endpointPublicKeyHash); fieldSetFlags()[1] = true; } if (isValidValue(fields()[2], other.profileHash)) { this.profileHash = data().deepCopy(fields()[2].schema(), other.profileHash); fieldSetFlags()[2] = true; } if (isValidValue(fields()[3], other.timeout)) { this.timeout = data().deepCopy(fields()[3].schema(), other.timeout); fieldSetFlags()[3] = true; } } /** * Creates a Builder by copying an existing SyncRequestMetaData instance */ private Builder(org.kaaproject.kaa.common.endpoint.gen.SyncRequestMetaData other) { super(org.kaaproject.kaa.common.endpoint.gen.SyncRequestMetaData.SCHEMA$); if (isValidValue(fields()[0], other.sdkToken)) { this.sdkToken = data().deepCopy(fields()[0].schema(), other.sdkToken); fieldSetFlags()[0] = true; } if (isValidValue(fields()[1], other.endpointPublicKeyHash)) { this.endpointPublicKeyHash = data().deepCopy(fields()[1].schema(), other.endpointPublicKeyHash); fieldSetFlags()[1] = true; } if (isValidValue(fields()[2], other.profileHash)) { this.profileHash = data().deepCopy(fields()[2].schema(), other.profileHash); fieldSetFlags()[2] = true; } if (isValidValue(fields()[3], other.timeout)) { this.timeout = data().deepCopy(fields()[3].schema(), other.timeout); fieldSetFlags()[3] = true; } } /** * Gets the value of the 'sdkToken' field */ public java.lang.String getSdkToken() { return sdkToken; } /** * Sets the value of the 'sdkToken' field */ public org.kaaproject.kaa.common.endpoint.gen.SyncRequestMetaData.Builder setSdkToken(java.lang.String value) { validate(fields()[0], value); this.sdkToken = value; fieldSetFlags()[0] = true; return this; } /** * Checks whether the 'sdkToken' field has been set */ public boolean hasSdkToken() { return fieldSetFlags()[0]; } /** * Clears the value of the 'sdkToken' field */ public org.kaaproject.kaa.common.endpoint.gen.SyncRequestMetaData.Builder clearSdkToken() { sdkToken = null; fieldSetFlags()[0] = false; return this; } /** * Gets the value of the 'endpointPublicKeyHash' field */ public java.nio.ByteBuffer getEndpointPublicKeyHash() { return endpointPublicKeyHash; } /** * Sets the value of the 'endpointPublicKeyHash' field */ public org.kaaproject.kaa.common.endpoint.gen.SyncRequestMetaData.Builder setEndpointPublicKeyHash(java.nio.ByteBuffer value) { validate(fields()[1], value); this.endpointPublicKeyHash = value; fieldSetFlags()[1] = true; return this; } /** * Checks whether the 'endpointPublicKeyHash' field has been set */ public boolean hasEndpointPublicKeyHash() { return fieldSetFlags()[1]; } /** * Clears the value of the 'endpointPublicKeyHash' field */ public org.kaaproject.kaa.common.endpoint.gen.SyncRequestMetaData.Builder clearEndpointPublicKeyHash() { endpointPublicKeyHash = null; fieldSetFlags()[1] = false; return this; } /** * Gets the value of the 'profileHash' field */ public java.nio.ByteBuffer getProfileHash() { return profileHash; } /** * Sets the value of the 'profileHash' field */ public org.kaaproject.kaa.common.endpoint.gen.SyncRequestMetaData.Builder setProfileHash(java.nio.ByteBuffer value) { validate(fields()[2], value); this.profileHash = value; fieldSetFlags()[2] = true; return this; } /** * Checks whether the 'profileHash' field has been set */ public boolean hasProfileHash() { return fieldSetFlags()[2]; } /** * Clears the value of the 'profileHash' field */ public org.kaaproject.kaa.common.endpoint.gen.SyncRequestMetaData.Builder clearProfileHash() { profileHash = null; fieldSetFlags()[2] = false; return this; } /** * Gets the value of the 'timeout' field */ public java.lang.Long getTimeout() { return timeout; } /** * Sets the value of the 'timeout' field */ public org.kaaproject.kaa.common.endpoint.gen.SyncRequestMetaData.Builder setTimeout(java.lang.Long value) { validate(fields()[3], value); this.timeout = value; fieldSetFlags()[3] = true; return this; } /** * Checks whether the 'timeout' field has been set */ public boolean hasTimeout() { return fieldSetFlags()[3]; } /** * Clears the value of the 'timeout' field */ public org.kaaproject.kaa.common.endpoint.gen.SyncRequestMetaData.Builder clearTimeout() { timeout = null; fieldSetFlags()[3] = false; return this; } @Override public SyncRequestMetaData build() { try { SyncRequestMetaData record = new SyncRequestMetaData(); record.sdkToken = fieldSetFlags()[0] ? this.sdkToken : (java.lang.String) defaultValue(fields()[0]); record.endpointPublicKeyHash = fieldSetFlags()[1] ? this.endpointPublicKeyHash : (java.nio.ByteBuffer) defaultValue(fields()[1]); record.profileHash = fieldSetFlags()[2] ? this.profileHash : (java.nio.ByteBuffer) defaultValue(fields()[2]); record.timeout = fieldSetFlags()[3] ? this.timeout : (java.lang.Long) defaultValue(fields()[3]); return record; } catch (Exception e) { throw new org.apache.avro.AvroRuntimeException(e); } } } }