Record Class Income
java.lang.Object
java.lang.Record
com.truebubo.maniflow.income.Income
- Record Components:
value
- How much is the new incomecurrencyDesignation
- What currency the income is increated
- Timestamp of when the new income was approvedrepeatsAfterDays
- This will be automatically added after again after this many days
- All Implemented Interfaces:
MoneyExchange
public record Income(BigDecimal value, CurrencyDesignation currencyDesignation, Instant created, Integer repeatsAfterDays)
extends Record
implements MoneyExchange
Information about income
-
Constructor Summary
ConstructorsConstructorDescriptionIncome
(BigDecimal value, CurrencyDesignation currencyDesignation, Instant created) Constructor without repeatingIncome
(BigDecimal value, CurrencyDesignation currencyDesignation, Instant created, Integer repeatsAfterDays) Creates an instance of aIncome
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
-
Income
public Income(@NonNull BigDecimal value, @NonNull CurrencyDesignation currencyDesignation, @NonNull Instant created) Constructor without repeating- Parameters:
value
- How much is the new incomecurrencyDesignation
- What currency the income is increated
- Timestamp of when the new income was approved
-
Income
public Income(@NonNull BigDecimal value, @NonNull CurrencyDesignation currencyDesignation, @NonNull Instant created, @Nullable Integer repeatsAfterDays) Creates an instance of aIncome
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
-