Record Class ExpressionLanguageContractTest.Applicant

java.lang.Object
java.lang.Record
io.github.brantunger.unruly.test.ExpressionLanguageContractTest.Applicant
Record Components:
creditScore - The applicant's credit score, the property the contract test reads
Enclosing class:
ExpressionLanguageContractTest

public static record ExpressionLanguageContractTest.Applicant(int creditScore) extends Record
An applicant, so a language's tests can run a rule against a record fact. It's a record because a record is what languages most often get wrong: its component is a method, so a language that looks only for a getter or a field reads nothing.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Applicant(int creditScore)
    Creates an instance of a Applicant record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns the value of the creditScore record component.
    final boolean
    equals(@Nullable Object other)
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    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

    • Applicant

      public Applicant(int creditScore)
      Creates an instance of a Applicant record class.
      Parameters:
      creditScore - the value for the creditScore record component
  • Method Details

    • equals

      public final boolean equals(@Nullable Object other)
      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. All components in this record class are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      other - the object with which to compare
      Returns:
      true if this object is the same as the other argument; false otherwise.
    • 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
    • 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
    • creditScore

      public int creditScore()
      Returns the value of the creditScore record component.
      Returns:
      the value of the creditScore record component