Class Record

  • All Implemented Interfaces:
    java.io.Serializable, Copyable<Record>

    public class Record
    extends java.lang.Object
    implements java.io.Serializable, Copyable<Record>
    A Type that represents a record with a schema, might be replaced with something standard like JPA entity.
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      Record​(java.lang.Object... values)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Record copy()
      Create a (potentially shallow) copy of this instance.
      boolean equals​(java.lang.Object o)  
      double getDouble​(int index)
      Retrieve a field as a double.
      java.lang.Object getField​(int index)  
      int getInt​(int index)
      Retrieve a field as a int.
      long getLong​(int index)
      Retrieve a field as a long.
      java.lang.String getString​(int index)
      Retrieve a field as a String.
      int hashCode()  
      int size()
      Retrieve the size of this instance.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • Record

        public Record​(java.lang.Object... values)
    • Method Detail

      • copy

        public Record copy()
        Description copied from interface: Copyable
        Create a (potentially shallow) copy of this instance.
        Specified by:
        copy in interface Copyable<Record>
        Returns:
        the copy
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • getField

        public java.lang.Object getField​(int index)
      • getDouble

        public double getDouble​(int index)
        Retrieve a field as a double. It must be castable as such.
        Parameters:
        index - the index of the field
        Returns:
        the double representation of the field
      • getLong

        public long getLong​(int index)
        Retrieve a field as a long. It must be castable as such.
        Parameters:
        index - the index of the field
        Returns:
        the long representation of the field
      • getInt

        public int getInt​(int index)
        Retrieve a field as a int. It must be castable as such.
        Parameters:
        index - the index of the field
        Returns:
        the int representation of the field
      • getString

        public java.lang.String getString​(int index)
        Retrieve a field as a String.
        Parameters:
        index - the index of the field
        Returns:
        the field as a String (obtained via Object.toString()) or null if the field is null
      • size

        public int size()
        Retrieve the size of this instance.
        Returns:
        the number of fields in this instance