/** * Autogenerated by Avro * * DO NOT EDIT DIRECTLY */ package org.kaaproject.kaa.common.endpoint.gen; @SuppressWarnings("all") @org.apache.avro.specific.AvroGenerated public class LogSyncRequest 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\":\"LogSyncRequest\",\"namespace\":\"org.kaaproject.kaa.common.endpoint.gen\",\"fields\":[{\"name\":\"requestId\",\"type\":\"int\"},{\"name\":\"logEntries\",\"type\":[{\"type\":\"array\",\"items\":{\"type\":\"record\",\"name\":\"LogEntry\",\"fields\":[{\"name\":\"data\",\"type\":\"bytes\"}],\"direction\":\"out\"}},\"null\"]}],\"direction\":\"out\"}"); private int requestId; private java.util.List<org.kaaproject.kaa.common.endpoint.gen.LogEntry> logEntries; /** * 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 LogSyncRequest() { } /** * All-args constructor. */ public LogSyncRequest(java.lang.Integer requestId, java.util.List<org.kaaproject.kaa.common.endpoint.gen.LogEntry> logEntries) { this.requestId = requestId; this.logEntries = logEntries; } public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; } /** * Creates a new LogSyncRequest RecordBuilder */ public static org.kaaproject.kaa.common.endpoint.gen.LogSyncRequest.Builder newBuilder() { return new org.kaaproject.kaa.common.endpoint.gen.LogSyncRequest.Builder(); } /** * Creates a new LogSyncRequest RecordBuilder by copying an existing Builder */ public static org.kaaproject.kaa.common.endpoint.gen.LogSyncRequest.Builder newBuilder(org.kaaproject.kaa.common.endpoint.gen.LogSyncRequest.Builder other) { return new org.kaaproject.kaa.common.endpoint.gen.LogSyncRequest.Builder(other); } /** * Creates a new LogSyncRequest RecordBuilder by copying an existing LogSyncRequest instance */ public static org.kaaproject.kaa.common.endpoint.gen.LogSyncRequest.Builder newBuilder(org.kaaproject.kaa.common.endpoint.gen.LogSyncRequest other) { return new org.kaaproject.kaa.common.endpoint.gen.LogSyncRequest.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 requestId; case 1: return logEntries; 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: requestId = (java.lang.Integer) value$; break; case 1: logEntries = (java.util.List<org.kaaproject.kaa.common.endpoint.gen.LogEntry>) value$; break; default: throw new org.apache.avro.AvroRuntimeException("Bad index"); } } /** * Gets the value of the 'requestId' field. */ public java.lang.Integer getRequestId() { return requestId; } /** * Sets the value of the 'requestId' field. * * @param value the value to set. */ public void setRequestId(java.lang.Integer value) { this.requestId = value; } /** * Gets the value of the 'logEntries' field. */ public java.util.List<org.kaaproject.kaa.common.endpoint.gen.LogEntry> getLogEntries() { return logEntries; } /** * Sets the value of the 'logEntries' field. * * @param value the value to set. */ public void setLogEntries(java.util.List<org.kaaproject.kaa.common.endpoint.gen.LogEntry> value) { this.logEntries = value; } /** * RecordBuilder for LogSyncRequest instances. */ public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<LogSyncRequest> implements org.apache.avro.data.RecordBuilder<LogSyncRequest> { private int requestId; private java.util.List<org.kaaproject.kaa.common.endpoint.gen.LogEntry> logEntries; /** * Creates a new Builder */ private Builder() { super(org.kaaproject.kaa.common.endpoint.gen.LogSyncRequest.SCHEMA$); } /** * Creates a Builder by copying an existing Builder */ private Builder(org.kaaproject.kaa.common.endpoint.gen.LogSyncRequest.Builder other) { super(other); if (isValidValue(fields()[0], other.requestId)) { this.requestId = data().deepCopy(fields()[0].schema(), other.requestId); fieldSetFlags()[0] = true; } if (isValidValue(fields()[1], other.logEntries)) { this.logEntries = data().deepCopy(fields()[1].schema(), other.logEntries); fieldSetFlags()[1] = true; } } /** * Creates a Builder by copying an existing LogSyncRequest instance */ private Builder(org.kaaproject.kaa.common.endpoint.gen.LogSyncRequest other) { super(org.kaaproject.kaa.common.endpoint.gen.LogSyncRequest.SCHEMA$); if (isValidValue(fields()[0], other.requestId)) { this.requestId = data().deepCopy(fields()[0].schema(), other.requestId); fieldSetFlags()[0] = true; } if (isValidValue(fields()[1], other.logEntries)) { this.logEntries = data().deepCopy(fields()[1].schema(), other.logEntries); fieldSetFlags()[1] = true; } } /** * Gets the value of the 'requestId' field */ public java.lang.Integer getRequestId() { return requestId; } /** * Sets the value of the 'requestId' field */ public org.kaaproject.kaa.common.endpoint.gen.LogSyncRequest.Builder setRequestId(int value) { validate(fields()[0], value); this.requestId = value; fieldSetFlags()[0] = true; return this; } /** * Checks whether the 'requestId' field has been set */ public boolean hasRequestId() { return fieldSetFlags()[0]; } /** * Clears the value of the 'requestId' field */ public org.kaaproject.kaa.common.endpoint.gen.LogSyncRequest.Builder clearRequestId() { fieldSetFlags()[0] = false; return this; } /** * Gets the value of the 'logEntries' field */ public java.util.List<org.kaaproject.kaa.common.endpoint.gen.LogEntry> getLogEntries() { return logEntries; } /** * Sets the value of the 'logEntries' field */ public org.kaaproject.kaa.common.endpoint.gen.LogSyncRequest.Builder setLogEntries(java.util.List<org.kaaproject.kaa.common.endpoint.gen.LogEntry> value) { validate(fields()[1], value); this.logEntries = value; fieldSetFlags()[1] = true; return this; } /** * Checks whether the 'logEntries' field has been set */ public boolean hasLogEntries() { return fieldSetFlags()[1]; } /** * Clears the value of the 'logEntries' field */ public org.kaaproject.kaa.common.endpoint.gen.LogSyncRequest.Builder clearLogEntries() { logEntries = null; fieldSetFlags()[1] = false; return this; } @Override public LogSyncRequest build() { try { LogSyncRequest record = new LogSyncRequest(); record.requestId = fieldSetFlags()[0] ? this.requestId : (java.lang.Integer) defaultValue(fields()[0]); record.logEntries = fieldSetFlags()[1] ? this.logEntries : (java.util.List<org.kaaproject.kaa.common.endpoint.gen.LogEntry>) defaultValue(fields()[1]); return record; } catch (Exception e) { throw new org.apache.avro.AvroRuntimeException(e); } } } }