Record Class Income

java.lang.Object
java.lang.Record
com.truebubo.maniflow.income.Income
Record Components:
value - How much is the new income
currencyDesignation - What currency the income is in
created - Timestamp of when the new income was approved
repeatsAfterDays - 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 Details

    • Income

      public Income(@NonNull BigDecimal value, @NonNull CurrencyDesignation currencyDesignation, @NonNull Instant created)
      Constructor without repeating
      Parameters:
      value - How much is the new income
      currencyDesignation - What currency the income is in
      created - 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 a Income record class.
      Parameters:
      value - the value for the value record component
      currencyDesignation - the value for the currencyDesignation record component
      created - the value for the created record component
      repeatsAfterDays - the value for the repeatsAfterDays 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.
    • value

      @NonNull public BigDecimal value()
      Returns the value of the value record component.
      Specified by:
      value in interface MoneyExchange
      Returns:
      the value of the value record component
    • currencyDesignation

      @NonNull public CurrencyDesignation currencyDesignation()
      Returns the value of the currencyDesignation record component.
      Specified by:
      currencyDesignation in interface MoneyExchange
      Returns:
      the value of the currencyDesignation record component
    • created

      @NonNull public Instant created()
      Returns the value of the created record component.
      Specified by:
      created in interface MoneyExchange
      Returns:
      the value of the created record component
    • repeatsAfterDays

      @Nullable public Integer repeatsAfterDays()
      Returns the value of the repeatsAfterDays record component.
      Specified by:
      repeatsAfterDays in interface MoneyExchange
      Returns:
      the value of the repeatsAfterDays record component