Class BudgetRegister

java.lang.Object
no.ntnu.idatt1002.demo.data.budget.BudgetRegister

public class BudgetRegister extends Object
Class for containing and organizing budget names. A budget name is the name that is given to a budget when it is created.
Since:
19.04.2023
Author:
Harry Linrui Xu
  • Constructor Details

    • BudgetRegister

      public BudgetRegister()
      Constructor for the register. Instantiates the arraylist that contains all budget names.
  • Method Details

    • getBudgetNames

      public List<String> getBudgetNames()
      Gets a list of the budget names contained in the budget register.
      Returns:
      Deep copied list of budget names.
    • addBudgetName

      public void addBudgetName(String name) throws IllegalArgumentException
      Method for adding a budget name to the register.
      Parameters:
      name - The name of the budget.
      Throws:
      IllegalArgumentException - If name is null, blank or already exists within the register.
    • removeBudgetName

      public void removeBudgetName(String name) throws IllegalArgumentException
      Method for removing a budget name from the register.
      Parameters:
      name - The name of the budget.
      Throws:
      IllegalArgumentException - If name is null or blank.
    • toString

      public String toString()
      Overrides:
      toString in class Object