Interface IncomeRepository

All Known Implementing Classes:
MongoIncomeRepository

public interface IncomeRepository
Interface used for dealing with storage and retrieval of income
  • Method Details

    • saveIncome

      Income saveIncome(@NonNull Income income)
      Saves the income to storage
      Parameters:
      income - Income saved
      Returns:
      income saved
    • getIncome

      Optional<Income> getIncome(int id)
      Finds the income with given id
      Parameters:
      id - as shown in list
      Returns:
      Income if found else empty
    • getIncomes

      List<Income> getIncomes()
      Finds all the incomes saved
      Returns:
      List of all the incomes saved
    • changeIncome

      Optional<Income> changeIncome(int id, @NonNull BigDecimal newAmount)
      Changes the income with given ID
      Parameters:
      id - ID identifying the income. It is the left value displayed when calling showIncomes
      newAmount - Will update the value to this value. If set to zero. The value will be removed
      Returns:
      new income if changed, else empty