Package io.github.brantunger.unruly.test
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
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 -
Method Summary
Modifier and TypeMethodDescriptionintReturns the value of thecreditScorerecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Applicant
public Applicant(int creditScore) Creates an instance of aApplicantrecord class.- Parameters:
creditScore- the value for thecreditScorerecord component
-
-
Method Details
-
equals
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 '=='. -
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. -
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. -
creditScore
public int creditScore()Returns the value of thecreditScorerecord component.- Returns:
- the value of the
creditScorerecord component
-