Package Model

Class UtilityBill

java.lang.Object
Model.UtilityBill

public class UtilityBill extends Object
The UtilityBill class represents a utility bill associated with a specific customer. It encompasses crucial details like the unique identifier (id), customer's username, type of utility (e.g., electricity, gas, water), meter measurement, calculated price, service type (GAS, ELECTRICITY, WATER), and the date of the bill.
  • Field Details

    • id

      private int id
      The unique identifier of the bill.
    • userName

      private String userName
      The username of the customer.
    • utilityType

      private String utilityType
      The type of utility.
    • meterMeasurement

      private double meterMeasurement
      The meter measurement.
    • price

      private double price
      The calculated price.
    • type

      private ServiceType type
      The service type.
    • date

      private String date
      The date of the bill.
  • Constructor Details

    • UtilityBill

      public UtilityBill(int id, String userName, String utilityType, double meterMeasurement, double price, String date)
      Constructs a UtilityBill object with the provided details.

      Constructor Details

      This constructor initializes a new utility bill object with the specified attributes, including the unique identifier (id), customer's username, utility type, meter measurement, price, and date.
      Parameters:
      id - The unique identifier for the utility bill.
      userName - The username of the customer associated with the bill.
      utilityType - The type of utility (e.g., electricity, gas, water).
      meterMeasurement - The meter measurement for the utility.
      price - The total price of the utility bill.
      date - The date of the utility bill.
      See Also:
      • #setPrice()
  • Method Details

    • setType

      public void setType(ServiceType type)
      Sets the service type for the utility bill.

      Method Details

      This method sets the service type for the utility bill, allowing for categorization based on the type of utility service (e.g., GAS, ELECTRICITY, WATER).
      Parameters:
      type - The service type to be set for the utility bill.
      See Also:
    • getType

      public ServiceType getType()
      Returns the service type associated with the utility bill.

      Method Details

      This method retrieves the service type assigned to the utility bill, which indicates the category of the utility service (e.g., GAS, ELECTRICITY, WATER).
      Returns:
      The service type associated with the utility bill.
      See Also:
    • setDate

      public void setDate(String date)
      Sets the date for the utility bill.

      Method Details

      This method sets the date for the utility bill, indicating the specific date of the bill.
      Parameters:
      date - The date to be set for the utility bill.
    • getDate

      public String getDate()
      Retrieves the date associated with the utility bill.

      Method Details

      This method retrieves the date assigned to the utility bill, representing the specific date of the bill.
      Returns:
      The date associated with the utility bill.
    • getId

      public int getId()
      gets the ID of the utility bill.

      Method Details

      This method retrieves the ID of the utility bill.
      Returns:
      the ID of the utility bill.
    • getUserName

      public String getUserName()
      gets the username of the customer.

      Method Details

      This method retrieves the username of the customer.
      Returns:
      the username of the customer.
    • getUtilityType

      public String getUtilityType()
      gets the type of utility.

      Method Details

      This method retrieves the type of utility.
      Returns:
      the type of utility.
    • getMeterMeasurement

      public double getMeterMeasurement()
      gets the meter measurement.

      Method Details

      This method retrieves the meter measurement.
      Returns:
      the meter measurement.
    • getPrice

      public double getPrice()
      gets the price.

      Method Details

      This method retrieves the price.
      Returns:
      the price.
    • setprice

      public void setprice()
      sets the price.

      Method Details

      This method sets the price.
      Parameters:
      price - the price to be set.
    • setMeterMeasurement

      public void setMeterMeasurement(double parseInt)
      sets the ID.

      Method Details

      This method sets the ID.
      Parameters:
      parseInt - the ID to be set.