Record Class ThingRecord

java.lang.Object
java.lang.Record
com.github.dkfellows.notabuilder.ThingRecord
Record Components:
foo - The foo field.
bar - The bar field.
grill - The grill field.
quux - The quux field.

public record ThingRecord(int foo, int bar, double grill, String quux) extends Record
A record that has four fields.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static interface 
    Argument labeller.
  • Constructor Summary

    Constructors
    Constructor
    Description
    ThingRecord(int foo, int bar, double grill, String quux)
    Creates an instance of a ThingRecord record class.
    Make an instance of the record.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    bar()
    Returns the value of the bar record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    int
    foo()
    Returns the value of the foo record component.
    double
    Returns the value of the grill record component.
    final int
    Returns a hash code value for this object.
    Returns the value of the quux record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

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

  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • foo

      public int foo()
      Returns the value of the foo record component.
      Returns:
      the value of the foo record component
    • bar

      public int bar()
      Returns the value of the bar record component.
      Returns:
      the value of the bar record component
    • grill

      public double grill()
      Returns the value of the grill record component.
      Returns:
      the value of the grill record component
    • quux

      public String quux()
      Returns the value of the quux record component.
      Returns:
      the value of the quux record component