/** * Autogenerated by Avro * * DO NOT EDIT DIRECTLY */ package br.com.produban.openbus.model.avro; @SuppressWarnings("all") /** Logs for not so important stuff. */ @org.apache.avro.specific.AvroGenerated public class RequestAvro 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\":\"RequestAvro\",\"namespace\":\"br.com.inmetrics.openbus.model.avro\",\"doc\":\"Logs for not so important stuff.\",\"fields\":[{\"name\":\"request\",\"type\":\"string\"},{\"name\":\"host\",\"type\":\"string\"},{\"name\":\"host_metadata\",\"type\":[\"string\",\"null\"]},{\"name\":\"ip\",\"type\":[\"string\",\"null\"]},{\"name\":\"port\",\"type\":[\"string\",\"null\"]},{\"name\":\"data\",\"type\":{\"type\":\"array\",\"items\":{\"type\":\"record\",\"name\":\"AgentDataAvro\",\"fields\":[{\"name\":\"host\",\"type\":\"string\"},{\"name\":\"host_metadata\",\"type\":[\"string\",\"null\"]},{\"name\":\"key\",\"type\":\"string\"},{\"name\":\"value\",\"type\":\"string\"},{\"name\":\"lastlogsize\",\"type\":[\"string\",\"null\"]},{\"name\":\"mtime\",\"type\":[\"string\",\"null\"]},{\"name\":\"timestamp\",\"type\":[\"string\",\"null\"]},{\"name\":\"source\",\"type\":[\"string\",\"null\"]},{\"name\":\"severity\",\"type\":[\"string\",\"null\"]},{\"name\":\"eventid\",\"type\":[\"string\",\"null\"]},{\"name\":\"state\",\"type\":[\"string\",\"null\"]},{\"name\":\"clock\",\"type\":\"string\"},{\"name\":\"ns\",\"type\":[\"string\",\"null\"]}],\"aliases\":[\"AgentData\"]}}},{\"name\":\"clock\",\"type\":\"long\"},{\"name\":\"ns\",\"type\":[\"string\",\"null\"]}]}"); public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; } @Deprecated public java.lang.CharSequence request; @Deprecated public java.lang.CharSequence host; @Deprecated public java.lang.CharSequence host_metadata; @Deprecated public java.lang.CharSequence ip; @Deprecated public java.lang.CharSequence port; @Deprecated public java.util.List<br.com.produban.openbus.model.avro.AgentDataAvro> data; @Deprecated public long clock; @Deprecated public java.lang.CharSequence ns; /** * Default constructor. Note that this does not initialize fields * to their default values from the schema. If that is desired then * one should use <code>newBuilder()</code>. */ public RequestAvro() {} /** * All-args constructor. */ public RequestAvro(java.lang.CharSequence request, java.lang.CharSequence host, java.lang.CharSequence host_metadata, java.lang.CharSequence ip, java.lang.CharSequence port, java.util.List<br.com.produban.openbus.model.avro.AgentDataAvro> data, java.lang.Long clock, java.lang.CharSequence ns) { this.request = request; this.host = host; this.host_metadata = host_metadata; this.ip = ip; this.port = port; this.data = data; this.clock = clock; this.ns = ns; } 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 request; case 1: return host; case 2: return host_metadata; case 3: return ip; case 4: return port; case 5: return data; case 6: return clock; case 7: return ns; 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: request = (java.lang.CharSequence)value$; break; case 1: host = (java.lang.CharSequence)value$; break; case 2: host_metadata = (java.lang.CharSequence)value$; break; case 3: ip = (java.lang.CharSequence)value$; break; case 4: port = (java.lang.CharSequence)value$; break; case 5: data = (java.util.List<br.com.produban.openbus.model.avro.AgentDataAvro>)value$; break; case 6: clock = (java.lang.Long)value$; break; case 7: ns = (java.lang.CharSequence)value$; break; default: throw new org.apache.avro.AvroRuntimeException("Bad index"); } } /** * Gets the value of the 'request' field. */ public java.lang.CharSequence getRequest() { return request; } /** * Sets the value of the 'request' field. * @param value the value to set. */ public void setRequest(java.lang.CharSequence value) { this.request = value; } /** * Gets the value of the 'host' field. */ public java.lang.CharSequence getHost() { return host; } /** * Sets the value of the 'host' field. * @param value the value to set. */ public void setHost(java.lang.CharSequence value) { this.host = value; } /** * Gets the value of the 'host_metadata' field. */ public java.lang.CharSequence getHostMetadata() { return host_metadata; } /** * Sets the value of the 'host_metadata' field. * @param value the value to set. */ public void setHostMetadata(java.lang.CharSequence value) { this.host_metadata = value; } /** * Gets the value of the 'ip' field. */ public java.lang.CharSequence getIp() { return ip; } /** * Sets the value of the 'ip' field. * @param value the value to set. */ public void setIp(java.lang.CharSequence value) { this.ip = value; } /** * Gets the value of the 'port' field. */ public java.lang.CharSequence getPort() { return port; } /** * Sets the value of the 'port' field. * @param value the value to set. */ public void setPort(java.lang.CharSequence value) { this.port = value; } /** * Gets the value of the 'data' field. */ public java.util.List<br.com.produban.openbus.model.avro.AgentDataAvro> getData() { return data; } /** * Sets the value of the 'data' field. * @param value the value to set. */ public void setData(java.util.List<br.com.produban.openbus.model.avro.AgentDataAvro> value) { this.data = value; } /** * Gets the value of the 'clock' field. */ public java.lang.Long getClock() { return clock; } /** * Sets the value of the 'clock' field. * @param value the value to set. */ public void setClock(java.lang.Long value) { this.clock = value; } /** * Gets the value of the 'ns' field. */ public java.lang.CharSequence getNs() { return ns; } /** * Sets the value of the 'ns' field. * @param value the value to set. */ public void setNs(java.lang.CharSequence value) { this.ns = value; } /** Creates a new RequestAvro RecordBuilder */ public static br.com.produban.openbus.model.avro.RequestAvro.Builder newBuilder() { return new br.com.produban.openbus.model.avro.RequestAvro.Builder(); } /** Creates a new RequestAvro RecordBuilder by copying an existing Builder */ public static br.com.produban.openbus.model.avro.RequestAvro.Builder newBuilder(br.com.produban.openbus.model.avro.RequestAvro.Builder other) { return new br.com.produban.openbus.model.avro.RequestAvro.Builder(other); } /** Creates a new RequestAvro RecordBuilder by copying an existing RequestAvro instance */ public static br.com.produban.openbus.model.avro.RequestAvro.Builder newBuilder(br.com.produban.openbus.model.avro.RequestAvro other) { return new br.com.produban.openbus.model.avro.RequestAvro.Builder(other); } /** * RecordBuilder for RequestAvro instances. */ public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<RequestAvro> implements org.apache.avro.data.RecordBuilder<RequestAvro> { private java.lang.CharSequence request; private java.lang.CharSequence host; private java.lang.CharSequence host_metadata; private java.lang.CharSequence ip; private java.lang.CharSequence port; private java.util.List<br.com.produban.openbus.model.avro.AgentDataAvro> data; private long clock; private java.lang.CharSequence ns; /** Creates a new Builder */ private Builder() { super(br.com.produban.openbus.model.avro.RequestAvro.SCHEMA$); } /** Creates a Builder by copying an existing Builder */ private Builder(br.com.produban.openbus.model.avro.RequestAvro.Builder other) { super(other); if (isValidValue(fields()[0], other.request)) { this.request = data().deepCopy(fields()[0].schema(), other.request); fieldSetFlags()[0] = true; } if (isValidValue(fields()[1], other.host)) { this.host = data().deepCopy(fields()[1].schema(), other.host); fieldSetFlags()[1] = true; } if (isValidValue(fields()[2], other.host_metadata)) { this.host_metadata = data().deepCopy(fields()[2].schema(), other.host_metadata); fieldSetFlags()[2] = true; } if (isValidValue(fields()[3], other.ip)) { this.ip = data().deepCopy(fields()[3].schema(), other.ip); fieldSetFlags()[3] = true; } if (isValidValue(fields()[4], other.port)) { this.port = data().deepCopy(fields()[4].schema(), other.port); fieldSetFlags()[4] = true; } if (isValidValue(fields()[5], other.data)) { this.data = data().deepCopy(fields()[5].schema(), other.data); fieldSetFlags()[5] = true; } if (isValidValue(fields()[6], other.clock)) { this.clock = data().deepCopy(fields()[6].schema(), other.clock); fieldSetFlags()[6] = true; } if (isValidValue(fields()[7], other.ns)) { this.ns = data().deepCopy(fields()[7].schema(), other.ns); fieldSetFlags()[7] = true; } } /** Creates a Builder by copying an existing RequestAvro instance */ private Builder(br.com.produban.openbus.model.avro.RequestAvro other) { super(br.com.produban.openbus.model.avro.RequestAvro.SCHEMA$); if (isValidValue(fields()[0], other.request)) { this.request = data().deepCopy(fields()[0].schema(), other.request); fieldSetFlags()[0] = true; } if (isValidValue(fields()[1], other.host)) { this.host = data().deepCopy(fields()[1].schema(), other.host); fieldSetFlags()[1] = true; } if (isValidValue(fields()[2], other.host_metadata)) { this.host_metadata = data().deepCopy(fields()[2].schema(), other.host_metadata); fieldSetFlags()[2] = true; } if (isValidValue(fields()[3], other.ip)) { this.ip = data().deepCopy(fields()[3].schema(), other.ip); fieldSetFlags()[3] = true; } if (isValidValue(fields()[4], other.port)) { this.port = data().deepCopy(fields()[4].schema(), other.port); fieldSetFlags()[4] = true; } if (isValidValue(fields()[5], other.data)) { this.data = data().deepCopy(fields()[5].schema(), other.data); fieldSetFlags()[5] = true; } if (isValidValue(fields()[6], other.clock)) { this.clock = data().deepCopy(fields()[6].schema(), other.clock); fieldSetFlags()[6] = true; } if (isValidValue(fields()[7], other.ns)) { this.ns = data().deepCopy(fields()[7].schema(), other.ns); fieldSetFlags()[7] = true; } } /** Gets the value of the 'request' field */ public java.lang.CharSequence getRequest() { return request; } /** Sets the value of the 'request' field */ public br.com.produban.openbus.model.avro.RequestAvro.Builder setRequest(java.lang.CharSequence value) { validate(fields()[0], value); this.request = value; fieldSetFlags()[0] = true; return this; } /** Checks whether the 'request' field has been set */ public boolean hasRequest() { return fieldSetFlags()[0]; } /** Clears the value of the 'request' field */ public br.com.produban.openbus.model.avro.RequestAvro.Builder clearRequest() { request = null; fieldSetFlags()[0] = false; return this; } /** Gets the value of the 'host' field */ public java.lang.CharSequence getHost() { return host; } /** Sets the value of the 'host' field */ public br.com.produban.openbus.model.avro.RequestAvro.Builder setHost(java.lang.CharSequence value) { validate(fields()[1], value); this.host = value; fieldSetFlags()[1] = true; return this; } /** Checks whether the 'host' field has been set */ public boolean hasHost() { return fieldSetFlags()[1]; } /** Clears the value of the 'host' field */ public br.com.produban.openbus.model.avro.RequestAvro.Builder clearHost() { host = null; fieldSetFlags()[1] = false; return this; } /** Gets the value of the 'host_metadata' field */ public java.lang.CharSequence getHostMetadata() { return host_metadata; } /** Sets the value of the 'host_metadata' field */ public br.com.produban.openbus.model.avro.RequestAvro.Builder setHostMetadata(java.lang.CharSequence value) { validate(fields()[2], value); this.host_metadata = value; fieldSetFlags()[2] = true; return this; } /** Checks whether the 'host_metadata' field has been set */ public boolean hasHostMetadata() { return fieldSetFlags()[2]; } /** Clears the value of the 'host_metadata' field */ public br.com.produban.openbus.model.avro.RequestAvro.Builder clearHostMetadata() { host_metadata = null; fieldSetFlags()[2] = false; return this; } /** Gets the value of the 'ip' field */ public java.lang.CharSequence getIp() { return ip; } /** Sets the value of the 'ip' field */ public br.com.produban.openbus.model.avro.RequestAvro.Builder setIp(java.lang.CharSequence value) { validate(fields()[3], value); this.ip = value; fieldSetFlags()[3] = true; return this; } /** Checks whether the 'ip' field has been set */ public boolean hasIp() { return fieldSetFlags()[3]; } /** Clears the value of the 'ip' field */ public br.com.produban.openbus.model.avro.RequestAvro.Builder clearIp() { ip = null; fieldSetFlags()[3] = false; return this; } /** Gets the value of the 'port' field */ public java.lang.CharSequence getPort() { return port; } /** Sets the value of the 'port' field */ public br.com.produban.openbus.model.avro.RequestAvro.Builder setPort(java.lang.CharSequence value) { validate(fields()[4], value); this.port = value; fieldSetFlags()[4] = true; return this; } /** Checks whether the 'port' field has been set */ public boolean hasPort() { return fieldSetFlags()[4]; } /** Clears the value of the 'port' field */ public br.com.produban.openbus.model.avro.RequestAvro.Builder clearPort() { port = null; fieldSetFlags()[4] = false; return this; } /** Gets the value of the 'data' field */ public java.util.List<br.com.produban.openbus.model.avro.AgentDataAvro> getData() { return data; } /** Sets the value of the 'data' field */ public br.com.produban.openbus.model.avro.RequestAvro.Builder setData(java.util.List<br.com.produban.openbus.model.avro.AgentDataAvro> value) { validate(fields()[5], value); this.data = value; fieldSetFlags()[5] = true; return this; } /** Checks whether the 'data' field has been set */ public boolean hasData() { return fieldSetFlags()[5]; } /** Clears the value of the 'data' field */ public br.com.produban.openbus.model.avro.RequestAvro.Builder clearData() { data = null; fieldSetFlags()[5] = false; return this; } /** Gets the value of the 'clock' field */ public java.lang.Long getClock() { return clock; } /** Sets the value of the 'clock' field */ public br.com.produban.openbus.model.avro.RequestAvro.Builder setClock(long value) { validate(fields()[6], value); this.clock = value; fieldSetFlags()[6] = true; return this; } /** Checks whether the 'clock' field has been set */ public boolean hasClock() { return fieldSetFlags()[6]; } /** Clears the value of the 'clock' field */ public br.com.produban.openbus.model.avro.RequestAvro.Builder clearClock() { fieldSetFlags()[6] = false; return this; } /** Gets the value of the 'ns' field */ public java.lang.CharSequence getNs() { return ns; } /** Sets the value of the 'ns' field */ public br.com.produban.openbus.model.avro.RequestAvro.Builder setNs(java.lang.CharSequence value) { validate(fields()[7], value); this.ns = value; fieldSetFlags()[7] = true; return this; } /** Checks whether the 'ns' field has been set */ public boolean hasNs() { return fieldSetFlags()[7]; } /** Clears the value of the 'ns' field */ public br.com.produban.openbus.model.avro.RequestAvro.Builder clearNs() { ns = null; fieldSetFlags()[7] = false; return this; } @Override public RequestAvro build() { try { RequestAvro record = new RequestAvro(); record.request = fieldSetFlags()[0] ? this.request : (java.lang.CharSequence) defaultValue(fields()[0]); record.host = fieldSetFlags()[1] ? this.host : (java.lang.CharSequence) defaultValue(fields()[1]); record.host_metadata = fieldSetFlags()[2] ? this.host_metadata : (java.lang.CharSequence) defaultValue(fields()[2]); record.ip = fieldSetFlags()[3] ? this.ip : (java.lang.CharSequence) defaultValue(fields()[3]); record.port = fieldSetFlags()[4] ? this.port : (java.lang.CharSequence) defaultValue(fields()[4]); record.data = fieldSetFlags()[5] ? this.data : (java.util.List<br.com.produban.openbus.model.avro.AgentDataAvro>) defaultValue(fields()[5]); record.clock = fieldSetFlags()[6] ? this.clock : (java.lang.Long) defaultValue(fields()[6]); record.ns = fieldSetFlags()[7] ? this.ns : (java.lang.CharSequence) defaultValue(fields()[7]); return record; } catch (Exception e) { throw new org.apache.avro.AvroRuntimeException(e); } } } }