Class BudgetItem

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

public class BudgetItem extends Object
This class represents a budgetItem. This is essentially a budget category that user can add to their budgeting.
Author:
Adele
  • Constructor Details

    • BudgetItem

      public BudgetItem(double budgetAmount, String description, ExpenseCategory category)
      The constructor of a new Budgetitem.
      Parameters:
      budgetAmount - The amount of budget as a double
      description - A description of the budget as a String
      category - A category from ExpenseCategory
      Throws:
      IllegalArgumentException - if the budgetAmount is less than zero.
  • Method Details

    • getBudgetAmount

      public double getBudgetAmount()
      This method gets the BudgetAmount.
      Returns:
      the budgetAmount as a double
    • getAmountProperty

      public javafx.beans.property.DoubleProperty getAmountProperty()
      Gets the amount property of its corresponding amount value.
      Returns:
      The amount property.
    • setBudgetAmount

      public void setBudgetAmount(double amount)
      Sets the amount to the value of the argument.
      Parameters:
      amount - The value to which the amount will change.
    • getBudgetCategory

      public ExpenseCategory getBudgetCategory()
      This method gets the category.
      Returns:
      the category as one of the categories in ExpenseCategory
    • getCategoryProperty

      public javafx.beans.property.ObjectProperty<ExpenseCategory> getCategoryProperty()
      Gets the category property of its corresponding category value.
      Returns:
      The category property.
    • setBudgetCategory

      public void setBudgetCategory(ExpenseCategory category)
      Sets the budget category to the value of the argument.
      Parameters:
      category - Category to which the budget item will change.
    • getBudgetDescription

      public String getBudgetDescription()
      This method gets the description.
      Returns:
      the description as a String.
    • getDescriptionProperty

      public javafx.beans.property.StringProperty getDescriptionProperty()
      Gets the description property of its corresponding description value.
      Returns:
      The description property.
    • setBudgetDescription

      public void setBudgetDescription(String description)
      Sets the budget description to the value of the argument.
      Parameters:
      description - Description to which the budget description will change.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object