Back to project page Pipe.
The source code is released under:
MIT License
If you think the Android project Pipe listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.westudio.android.protocol; /*www . java 2 s. c o m*/ /** * Autogenerated by Avro * * DO NOT EDIT DIRECTLY */ @SuppressWarnings("all") @org.apache.avro.specific.AvroGenerated public class Person 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\":\"Person\",\"namespace\":\"com.westudio.java.protocol.v1\",\"fields\":[{\"name\":\"id\",\"type\":\"int\",\"default\":0},{\"name\":\"lastName\",\"type\":\"string\"},{\"name\":\"postCode\",\"type\":\"string\"},{\"name\":\"address1\",\"type\":\"string\"},{\"name\":\"address2\",\"type\":\"string\"},{\"name\":\"firstName\",\"type\":\"string\"},{\"name\":\"country\",\"type\":\"string\"},{\"name\":\"city\",\"type\":\"string\"}]}"); public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; } @Deprecated public int id; @Deprecated public CharSequence lastName; @Deprecated public CharSequence postCode; @Deprecated public CharSequence address1; @Deprecated public CharSequence address2; @Deprecated public CharSequence firstName; @Deprecated public CharSequence country; @Deprecated public CharSequence city; /** * 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 Person() {} /** * All-args constructor. */ public Person(Integer id, CharSequence lastName, CharSequence postCode, CharSequence address1, CharSequence address2, CharSequence firstName, CharSequence country, CharSequence city) { this.id = id; this.lastName = lastName; this.postCode = postCode; this.address1 = address1; this.address2 = address2; this.firstName = firstName; this.country = country; this.city = city; } public org.apache.avro.Schema getSchema() { return SCHEMA$; } // Used by DatumWriter. Applications should not call. public Object get(int field$) { switch (field$) { case 0: return id; case 1: return lastName; case 2: return postCode; case 3: return address1; case 4: return address2; case 5: return firstName; case 6: return country; case 7: return city; default: throw new org.apache.avro.AvroRuntimeException("Bad index"); } } // Used by DatumReader. Applications should not call. @SuppressWarnings(value="unchecked") public void put(int field$, Object value$) { switch (field$) { case 0: id = (Integer)value$; break; case 1: lastName = (CharSequence)value$; break; case 2: postCode = (CharSequence)value$; break; case 3: address1 = (CharSequence)value$; break; case 4: address2 = (CharSequence)value$; break; case 5: firstName = (CharSequence)value$; break; case 6: country = (CharSequence)value$; break; case 7: city = (CharSequence)value$; break; default: throw new org.apache.avro.AvroRuntimeException("Bad index"); } } /** * Gets the value of the 'id' field. */ public Integer getId() { return id; } /** * Sets the value of the 'id' field. * @param value the value to set. */ public void setId(Integer value) { this.id = value; } /** * Gets the value of the 'lastName' field. */ public CharSequence getLastName() { return lastName; } /** * Sets the value of the 'lastName' field. * @param value the value to set. */ public void setLastName(CharSequence value) { this.lastName = value; } /** * Gets the value of the 'postCode' field. */ public CharSequence getPostCode() { return postCode; } /** * Sets the value of the 'postCode' field. * @param value the value to set. */ public void setPostCode(CharSequence value) { this.postCode = value; } /** * Gets the value of the 'address1' field. */ public CharSequence getAddress1() { return address1; } /** * Sets the value of the 'address1' field. * @param value the value to set. */ public void setAddress1(CharSequence value) { this.address1 = value; } /** * Gets the value of the 'address2' field. */ public CharSequence getAddress2() { return address2; } /** * Sets the value of the 'address2' field. * @param value the value to set. */ public void setAddress2(CharSequence value) { this.address2 = value; } /** * Gets the value of the 'firstName' field. */ public CharSequence getFirstName() { return firstName; } /** * Sets the value of the 'firstName' field. * @param value the value to set. */ public void setFirstName(CharSequence value) { this.firstName = value; } /** * Gets the value of the 'country' field. */ public CharSequence getCountry() { return country; } /** * Sets the value of the 'country' field. * @param value the value to set. */ public void setCountry(CharSequence value) { this.country = value; } /** * Gets the value of the 'city' field. */ public CharSequence getCity() { return city; } /** * Sets the value of the 'city' field. * @param value the value to set. */ public void setCity(CharSequence value) { this.city = value; } /** Creates a new Person RecordBuilder */ public static Person.Builder newBuilder() { return new Person.Builder(); } /** Creates a new Person RecordBuilder by copying an existing Builder */ public static Person.Builder newBuilder(Person.Builder other) { return new Person.Builder(other); } /** Creates a new Person RecordBuilder by copying an existing Person instance */ public static Person.Builder newBuilder(Person other) { return new Person.Builder(other); } /** * RecordBuilder for Person instances. */ public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<Person> implements org.apache.avro.data.RecordBuilder<Person> { private int id; private CharSequence lastName; private CharSequence postCode; private CharSequence address1; private CharSequence address2; private CharSequence firstName; private CharSequence country; private CharSequence city; /** Creates a new Builder */ private Builder() { super(Person.SCHEMA$); } /** Creates a Builder by copying an existing Builder */ private Builder(Person.Builder other) { super(other); if (isValidValue(fields()[0], other.id)) { this.id = data().deepCopy(fields()[0].schema(), other.id); fieldSetFlags()[0] = true; } if (isValidValue(fields()[1], other.lastName)) { this.lastName = data().deepCopy(fields()[1].schema(), other.lastName); fieldSetFlags()[1] = true; } if (isValidValue(fields()[2], other.postCode)) { this.postCode = data().deepCopy(fields()[2].schema(), other.postCode); fieldSetFlags()[2] = true; } if (isValidValue(fields()[3], other.address1)) { this.address1 = data().deepCopy(fields()[3].schema(), other.address1); fieldSetFlags()[3] = true; } if (isValidValue(fields()[4], other.address2)) { this.address2 = data().deepCopy(fields()[4].schema(), other.address2); fieldSetFlags()[4] = true; } if (isValidValue(fields()[5], other.firstName)) { this.firstName = data().deepCopy(fields()[5].schema(), other.firstName); fieldSetFlags()[5] = true; } if (isValidValue(fields()[6], other.country)) { this.country = data().deepCopy(fields()[6].schema(), other.country); fieldSetFlags()[6] = true; } if (isValidValue(fields()[7], other.city)) { this.city = data().deepCopy(fields()[7].schema(), other.city); fieldSetFlags()[7] = true; } } /** Creates a Builder by copying an existing Person instance */ private Builder(Person other) { super(Person.SCHEMA$); if (isValidValue(fields()[0], other.id)) { this.id = data().deepCopy(fields()[0].schema(), other.id); fieldSetFlags()[0] = true; } if (isValidValue(fields()[1], other.lastName)) { this.lastName = data().deepCopy(fields()[1].schema(), other.lastName); fieldSetFlags()[1] = true; } if (isValidValue(fields()[2], other.postCode)) { this.postCode = data().deepCopy(fields()[2].schema(), other.postCode); fieldSetFlags()[2] = true; } if (isValidValue(fields()[3], other.address1)) { this.address1 = data().deepCopy(fields()[3].schema(), other.address1); fieldSetFlags()[3] = true; } if (isValidValue(fields()[4], other.address2)) { this.address2 = data().deepCopy(fields()[4].schema(), other.address2); fieldSetFlags()[4] = true; } if (isValidValue(fields()[5], other.firstName)) { this.firstName = data().deepCopy(fields()[5].schema(), other.firstName); fieldSetFlags()[5] = true; } if (isValidValue(fields()[6], other.country)) { this.country = data().deepCopy(fields()[6].schema(), other.country); fieldSetFlags()[6] = true; } if (isValidValue(fields()[7], other.city)) { this.city = data().deepCopy(fields()[7].schema(), other.city); fieldSetFlags()[7] = true; } } /** Gets the value of the 'id' field */ public Integer getId() { return id; } /** Sets the value of the 'id' field */ public Person.Builder setId(int value) { validate(fields()[0], value); this.id = value; fieldSetFlags()[0] = true; return this; } /** Checks whether the 'id' field has been set */ public boolean hasId() { return fieldSetFlags()[0]; } /** Clears the value of the 'id' field */ public Person.Builder clearId() { fieldSetFlags()[0] = false; return this; } /** Gets the value of the 'lastName' field */ public CharSequence getLastName() { return lastName; } /** Sets the value of the 'lastName' field */ public Person.Builder setLastName(CharSequence value) { validate(fields()[1], value); this.lastName = value; fieldSetFlags()[1] = true; return this; } /** Checks whether the 'lastName' field has been set */ public boolean hasLastName() { return fieldSetFlags()[1]; } /** Clears the value of the 'lastName' field */ public Person.Builder clearLastName() { lastName = null; fieldSetFlags()[1] = false; return this; } /** Gets the value of the 'postCode' field */ public CharSequence getPostCode() { return postCode; } /** Sets the value of the 'postCode' field */ public Person.Builder setPostCode(CharSequence value) { validate(fields()[2], value); this.postCode = value; fieldSetFlags()[2] = true; return this; } /** Checks whether the 'postCode' field has been set */ public boolean hasPostCode() { return fieldSetFlags()[2]; } /** Clears the value of the 'postCode' field */ public Person.Builder clearPostCode() { postCode = null; fieldSetFlags()[2] = false; return this; } /** Gets the value of the 'address1' field */ public CharSequence getAddress1() { return address1; } /** Sets the value of the 'address1' field */ public Person.Builder setAddress1(CharSequence value) { validate(fields()[3], value); this.address1 = value; fieldSetFlags()[3] = true; return this; } /** Checks whether the 'address1' field has been set */ public boolean hasAddress1() { return fieldSetFlags()[3]; } /** Clears the value of the 'address1' field */ public Person.Builder clearAddress1() { address1 = null; fieldSetFlags()[3] = false; return this; } /** Gets the value of the 'address2' field */ public CharSequence getAddress2() { return address2; } /** Sets the value of the 'address2' field */ public Person.Builder setAddress2(CharSequence value) { validate(fields()[4], value); this.address2 = value; fieldSetFlags()[4] = true; return this; } /** Checks whether the 'address2' field has been set */ public boolean hasAddress2() { return fieldSetFlags()[4]; } /** Clears the value of the 'address2' field */ public Person.Builder clearAddress2() { address2 = null; fieldSetFlags()[4] = false; return this; } /** Gets the value of the 'firstName' field */ public CharSequence getFirstName() { return firstName; } /** Sets the value of the 'firstName' field */ public Person.Builder setFirstName(CharSequence value) { validate(fields()[5], value); this.firstName = value; fieldSetFlags()[5] = true; return this; } /** Checks whether the 'firstName' field has been set */ public boolean hasFirstName() { return fieldSetFlags()[5]; } /** Clears the value of the 'firstName' field */ public Person.Builder clearFirstName() { firstName = null; fieldSetFlags()[5] = false; return this; } /** Gets the value of the 'country' field */ public CharSequence getCountry() { return country; } /** Sets the value of the 'country' field */ public Person.Builder setCountry(CharSequence value) { validate(fields()[6], value); this.country = value; fieldSetFlags()[6] = true; return this; } /** Checks whether the 'country' field has been set */ public boolean hasCountry() { return fieldSetFlags()[6]; } /** Clears the value of the 'country' field */ public Person.Builder clearCountry() { country = null; fieldSetFlags()[6] = false; return this; } /** Gets the value of the 'city' field */ public CharSequence getCity() { return city; } /** Sets the value of the 'city' field */ public Person.Builder setCity(CharSequence value) { validate(fields()[7], value); this.city = value; fieldSetFlags()[7] = true; return this; } /** Checks whether the 'city' field has been set */ public boolean hasCity() { return fieldSetFlags()[7]; } /** Clears the value of the 'city' field */ public Person.Builder clearCity() { city = null; fieldSetFlags()[7] = false; return this; } @Override public Person build() { try { Person record = new Person(); record.id = fieldSetFlags()[0] ? this.id : (Integer) defaultValue(fields()[0]); record.lastName = fieldSetFlags()[1] ? this.lastName : (CharSequence) defaultValue(fields()[1]); record.postCode = fieldSetFlags()[2] ? this.postCode : (CharSequence) defaultValue(fields()[2]); record.address1 = fieldSetFlags()[3] ? this.address1 : (CharSequence) defaultValue(fields()[3]); record.address2 = fieldSetFlags()[4] ? this.address2 : (CharSequence) defaultValue(fields()[4]); record.firstName = fieldSetFlags()[5] ? this.firstName : (CharSequence) defaultValue(fields()[5]); record.country = fieldSetFlags()[6] ? this.country : (CharSequence) defaultValue(fields()[6]); record.city = fieldSetFlags()[7] ? this.city : (CharSequence) defaultValue(fields()[7]); return record; } catch (Exception e) { throw new org.apache.avro.AvroRuntimeException(e); } } } }