Record Class Expense
java.lang.Object
java.lang.Record
com.truebubo.maniflow.expense.Expense
- Record Components:
value
- How much is the new expensecurrencyDesignation
- What currency the expense is increated
- Timestamp of when the new expense was approvedrepeatsAfterDays
- This will be automatically added after again after this many days, if does not repeat the value should be -1
- All Implemented Interfaces:
MoneyExchange
public record Expense(BigDecimal value, CurrencyDesignation currencyDesignation, Instant created, Integer repeatsAfterDays)
extends Record
implements MoneyExchange
Information about expense
-
Constructor Summary
ConstructorsConstructorDescriptionExpense
(BigDecimal value, CurrencyDesignation currencyDesignation, Instant created) Constructor without repeatingExpense
(BigDecimal value, CurrencyDesignation currencyDesignation, Instant created, Integer repeatsAfterDays) Creates an instance of aExpense
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.final int
hashCode()
Returns a hash code value for this object.Returns the value of therepeatsAfterDays
record component.final String
toString()
Returns a string representation of this record class.value()
Returns the value of thevalue
record component.
-
Constructor Details
-
Expense
public Expense(@NonNull BigDecimal value, @NonNull CurrencyDesignation currencyDesignation, @NonNull Instant created) Constructor without repeating- Parameters:
value
- How much is the new expensecurrencyDesignation
- What currency the expense is increated
- Timestamp of when the new expense was approved
-
Expense
public Expense(@NonNull BigDecimal value, @NonNull CurrencyDesignation currencyDesignation, @NonNull Instant created, @Nullable Integer repeatsAfterDays) Creates an instance of aExpense
record class.- Parameters:
value
- the value for thevalue
record componentcurrencyDesignation
- the value for thecurrencyDesignation
record componentcreated
- the value for thecreated
record componentrepeatsAfterDays
- the value for therepeatsAfterDays
record component
-
-
Method Details
-
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
Returns the value of thevalue
record component.- Specified by:
value
in interfaceMoneyExchange
- Returns:
- the value of the
value
record component
-
currencyDesignation
Returns the value of thecurrencyDesignation
record component.- Specified by:
currencyDesignation
in interfaceMoneyExchange
- Returns:
- the value of the
currencyDesignation
record component
-
created
Returns the value of thecreated
record component.- Specified by:
created
in interfaceMoneyExchange
- Returns:
- the value of the
created
record component
-
repeatsAfterDays
Returns the value of therepeatsAfterDays
record component.- Specified by:
repeatsAfterDays
in interfaceMoneyExchange
- Returns:
- the value of the
repeatsAfterDays
record component
-