Class Car

  • All Implemented Interfaces:
    Externalizable, Serializable, Comparable<org.apache.avro.specific.SpecificRecord>, org.apache.avro.generic.GenericContainer, org.apache.avro.generic.GenericRecord, org.apache.avro.generic.IndexedRecord, org.apache.avro.specific.SpecificRecord

    public class Car
    extends org.apache.avro.specific.SpecificRecordBase
    implements org.apache.avro.specific.SpecificRecord
    See Also:
    Serialized Form
    • Field Detail

      • SCHEMA$

        public static final org.apache.avro.Schema SCHEMA$
    • Constructor Detail

      • Car

        public Car()
        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().
      • Car

        public Car​(Long year,
                   String registration,
                   String make,
                   String model,
                   Vin vin,
                   Integer doors,
                   Engine engine,
                   Object optionalExtra,
                   List<Service> serviceHistory)
        All-args constructor.
        Parameters:
        year - The new value for year
        registration - The new value for registration
        make - The new value for make
        model - The new value for model
        vin - The new value for vin
        doors - The new value for doors
        engine - The new value for engine
        optionalExtra - The new value for optionalExtra
        serviceHistory - The new value for serviceHistory
    • Method Detail

      • getClassSchema

        public static org.apache.avro.Schema getClassSchema()
      • getEncoder

        public static org.apache.avro.message.BinaryMessageEncoder<Car> getEncoder()
        Return the BinaryMessageEncoder instance used by this class.
        Returns:
        the message encoder used by this class
      • getDecoder

        public static org.apache.avro.message.BinaryMessageDecoder<Car> getDecoder()
        Return the BinaryMessageDecoder instance used by this class.
        Returns:
        the message decoder used by this class
      • createDecoder

        public static org.apache.avro.message.BinaryMessageDecoder<Car> createDecoder​(org.apache.avro.message.SchemaStore resolver)
        Create a new BinaryMessageDecoder instance for this class that uses the specified SchemaStore.
        Parameters:
        resolver - a SchemaStore used to find schemas by fingerprint
        Returns:
        a BinaryMessageDecoder instance for this class backed by the given SchemaStore
      • toByteBuffer

        public ByteBuffer toByteBuffer()
                                throws IOException
        Serializes this Car to a ByteBuffer.
        Returns:
        a buffer holding the serialized data for this instance
        Throws:
        IOException - if this instance could not be serialized
      • fromByteBuffer

        public static Car fromByteBuffer​(ByteBuffer b)
                                  throws IOException
        Deserializes a Car from a ByteBuffer.
        Parameters:
        b - a byte buffer holding serialized data for an instance of this class
        Returns:
        a Car instance decoded from the given buffer
        Throws:
        IOException - if the given bytes could not be deserialized into an instance of this class
      • getSpecificData

        public org.apache.avro.specific.SpecificData getSpecificData()
        Overrides:
        getSpecificData in class org.apache.avro.specific.SpecificRecordBase
      • getSchema

        public org.apache.avro.Schema getSchema()
        Specified by:
        getSchema in interface org.apache.avro.generic.GenericContainer
        Specified by:
        getSchema in class org.apache.avro.specific.SpecificRecordBase
      • get

        public Object get​(int field$)
        Specified by:
        get in interface org.apache.avro.generic.IndexedRecord
        Specified by:
        get in class org.apache.avro.specific.SpecificRecordBase
      • put

        public void put​(int field$,
                        Object value$)
        Specified by:
        put in interface org.apache.avro.generic.IndexedRecord
        Specified by:
        put in class org.apache.avro.specific.SpecificRecordBase
      • getYear

        public long getYear()
        Gets the value of the 'year' field.
        Returns:
        The value of the 'year' field.
      • setYear

        public void setYear​(long value)
        Sets the value of the 'year' field.
        Parameters:
        value - the value to set.
      • getRegistration

        public String getRegistration()
        Gets the value of the 'registration' field.
        Returns:
        The value of the 'registration' field.
      • setRegistration

        public void setRegistration​(String value)
        Sets the value of the 'registration' field.
        Parameters:
        value - the value to set.
      • getMake

        public String getMake()
        Gets the value of the 'make' field.
        Returns:
        The value of the 'make' field.
      • setMake

        public void setMake​(String value)
        Sets the value of the 'make' field.
        Parameters:
        value - the value to set.
      • getModel

        public String getModel()
        Gets the value of the 'model' field.
        Returns:
        The value of the 'model' field.
      • setModel

        public void setModel​(String value)
        Sets the value of the 'model' field.
        Parameters:
        value - the value to set.
      • getVin

        public Vin getVin()
        Gets the value of the 'vin' field.
        Returns:
        The value of the 'vin' field.
      • setVin

        public void setVin​(Vin value)
        Sets the value of the 'vin' field.
        Parameters:
        value - the value to set.
      • getDoors

        public int getDoors()
        Gets the value of the 'doors' field.
        Returns:
        The value of the 'doors' field.
      • setDoors

        public void setDoors​(int value)
        Sets the value of the 'doors' field.
        Parameters:
        value - the value to set.
      • getEngine

        public Engine getEngine()
        Gets the value of the 'engine' field.
        Returns:
        The value of the 'engine' field.
      • setEngine

        public void setEngine​(Engine value)
        Sets the value of the 'engine' field.
        Parameters:
        value - the value to set.
      • getOptionalExtra

        public Object getOptionalExtra()
        Gets the value of the 'optionalExtra' field.
        Returns:
        The value of the 'optionalExtra' field.
      • setOptionalExtra

        public void setOptionalExtra​(Object value)
        Sets the value of the 'optionalExtra' field.
        Parameters:
        value - the value to set.
      • getServiceHistory

        public List<Service> getServiceHistory()
        Gets the value of the 'serviceHistory' field.
        Returns:
        The value of the 'serviceHistory' field.
      • setServiceHistory

        public void setServiceHistory​(List<Service> value)
        Sets the value of the 'serviceHistory' field.
        Parameters:
        value - the value to set.
      • newBuilder

        public static Car.Builder newBuilder()
        Creates a new Car RecordBuilder.
        Returns:
        A new Car RecordBuilder
      • newBuilder

        public static Car.Builder newBuilder​(Car.Builder other)
        Creates a new Car RecordBuilder by copying an existing Builder.
        Parameters:
        other - The existing builder to copy.
        Returns:
        A new Car RecordBuilder
      • newBuilder

        public static Car.Builder newBuilder​(Car other)
        Creates a new Car RecordBuilder by copying an existing Car instance.
        Parameters:
        other - The existing instance to copy.
        Returns:
        A new Car RecordBuilder