Record Class LoanService.Loan

java.lang.Object
java.lang.Record
com.github.darksoulq.abyssallib.server.economy.capability.LoanService.Loan
Enclosing interface:
LoanService

public static record LoanService.Loan(UUID id, Account borrower, Account lender, Currency currency, BigDecimal principal, BigDecimal remainingBalance, BigDecimal interestRate, Instant issueDate, Instant nextPaymentDue, Instant termEnd, EconomyContext context, LoanService.LoanState state) extends Record
  • Constructor Details

    • Loan

      public Loan(UUID id, Account borrower, Account lender, Currency currency, BigDecimal principal, BigDecimal remainingBalance, BigDecimal interestRate, Instant issueDate, Instant nextPaymentDue, Instant termEnd, EconomyContext context, LoanService.LoanState state)
      Creates an instance of a Loan record class.
      Parameters:
      id - the value for the id record component
      borrower - the value for the borrower record component
      lender - the value for the lender record component
      currency - the value for the currency record component
      principal - the value for the principal record component
      remainingBalance - the value for the remainingBalance record component
      interestRate - the value for the interestRate record component
      issueDate - the value for the issueDate record component
      nextPaymentDue - the value for the nextPaymentDue record component
      termEnd - the value for the termEnd record component
      context - the value for the context record component
      state - the value for the state record component
  • 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. All components in this record class are compared with Objects::equals(Object,Object).
      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.
    • id

      public UUID id()
      Returns the value of the id record component.
      Returns:
      the value of the id record component
    • borrower

      public Account borrower()
      Returns the value of the borrower record component.
      Returns:
      the value of the borrower record component
    • lender

      public Account lender()
      Returns the value of the lender record component.
      Returns:
      the value of the lender record component
    • currency

      public Currency currency()
      Returns the value of the currency record component.
      Returns:
      the value of the currency record component
    • principal

      public BigDecimal principal()
      Returns the value of the principal record component.
      Returns:
      the value of the principal record component
    • remainingBalance

      public BigDecimal remainingBalance()
      Returns the value of the remainingBalance record component.
      Returns:
      the value of the remainingBalance record component
    • interestRate

      public BigDecimal interestRate()
      Returns the value of the interestRate record component.
      Returns:
      the value of the interestRate record component
    • issueDate

      public Instant issueDate()
      Returns the value of the issueDate record component.
      Returns:
      the value of the issueDate record component
    • nextPaymentDue

      public Instant nextPaymentDue()
      Returns the value of the nextPaymentDue record component.
      Returns:
      the value of the nextPaymentDue record component
    • termEnd

      public Instant termEnd()
      Returns the value of the termEnd record component.
      Returns:
      the value of the termEnd record component
    • context

      public EconomyContext context()
      Returns the value of the context record component.
      Returns:
      the value of the context record component
    • state

      public LoanService.LoanState state()
      Returns the value of the state record component.
      Returns:
      the value of the state record component