Class NewCar

  • 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 NewCar
    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

      • NewCar

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

        public NewCar​(Long year,
                      String registration,
                      String brand,
                      String model,
                      Vin vin,
                      Long doors,
                      Engine engine,
                      Object optionalExtra,
                      List<Service> serviceHistory,
                      Integer opt,
                      String description)
        All-args constructor.
        Parameters:
        year - The new value for year
        registration - The new value for registration
        brand - The new value for brand
        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
        opt - The new value for opt
        description - The new value for description
    • Method Detail

      • getClassSchema

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

        public static org.apache.avro.message.BinaryMessageEncoder<NewCar> 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<NewCar> 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<NewCar> 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 NewCar 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 NewCar fromByteBuffer​(ByteBuffer b)
                                     throws IOException
        Deserializes a NewCar from a ByteBuffer.
        Parameters:
        b - a byte buffer holding serialized data for an instance of this class
        Returns:
        a NewCar 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.
      • getBrand

        public String getBrand()
        Gets the value of the 'brand' field.
        Returns:
        The value of the 'brand' field.
      • setBrand

        public void setBrand​(String value)
        Sets the value of the 'brand' 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 long getDoors()
        Gets the value of the 'doors' field.
        Returns:
        The value of the 'doors' field.
      • setDoors

        public void setDoors​(long 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.
      • getOpt

        public int getOpt()
        Gets the value of the 'opt' field.
        Returns:
        The value of the 'opt' field.
      • setOpt

        public void setOpt​(int value)
        Sets the value of the 'opt' field.
        Parameters:
        value - the value to set.
      • getDescription

        public String getDescription()
        Gets the value of the 'description' field.
        Returns:
        The value of the 'description' field.
      • setDescription

        public void setDescription​(String value)
        Sets the value of the 'description' field.
        Parameters:
        value - the value to set.
      • newBuilder

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

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

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