Record Class Debt
java.lang.Object
java.lang.Record
com.truebubo.maniflow.debt.Debt
- Record Components:
value
- How much is the new debtcurrencyDesignation
- What currency the debt is inyearlyInterest
- Interest rate on the debtcreated
- Timestamp of when the new debt was approved
public record Debt(BigDecimal value, CurrencyDesignation currencyDesignation, BigDecimal yearlyInterest, Instant created)
extends Record
Information about debt
-
Constructor Summary
ConstructorsConstructorDescriptionDebt
(BigDecimal value, CurrencyDesignation currencyDesignation, BigDecimal yearlyInterest, Instant created) Creates an instance of aDebt
record class. -
Method Summary
Modifier and TypeMethodDescriptioncreated()
Returns the value of thecreated
record component.Returns the value of thecurrencyDesignation
record component.final boolean
Indicates whether some other object is "equal to" this one.How much is the debt now including the interest that accumulated since last updatesfinal int
hashCode()
Returns a hash code value for this object.final String
toString()
Returns a string representation of this record class.value()
Returns the value of thevalue
record component.Returns the value of theyearlyInterest
record component.
-
Constructor Details
-
Debt
public Debt(@NonNull BigDecimal value, @NonNull CurrencyDesignation currencyDesignation, @NonNull BigDecimal yearlyInterest, @NonNull Instant created) Creates an instance of aDebt
record class.- Parameters:
value
- the value for thevalue
record componentcurrencyDesignation
- the value for thecurrencyDesignation
record componentyearlyInterest
- the value for theyearlyInterest
record componentcreated
- the value for thecreated
record component
-
-
Method Details
-
getValueWithInterest
How much is the debt now including the interest that accumulated since last updates- Returns:
- Value with interest
-
toString
-
hashCode
-
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 withObjects::equals(Object,Object)
. -
value
-
currencyDesignation
Returns the value of thecurrencyDesignation
record component.- Returns:
- the value of the
currencyDesignation
record component
-
yearlyInterest
Returns the value of theyearlyInterest
record component.- Returns:
- the value of the
yearlyInterest
record component
-
created
-