Package Model
Class UtilityBill
java.lang.Object
Model.UtilityBill
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 Summary
Modifier and TypeFieldDescriptionprivate String
The date of the bill.private int
The unique identifier of the bill.private double
The meter measurement.private double
The calculated price.private ServiceType
The service type.private String
The username of the customer.private String
The type of utility. -
Constructor Summary
ConstructorDescriptionUtilityBill
(int id, String userName, String utilityType, double meterMeasurement, double price, String date) Constructs a UtilityBill object with the provided details. -
Method Summary
Modifier and TypeMethodDescriptiongetDate()
Retrieves the date associated with the utility bill.int
getId()
gets the ID of the utility bill.double
gets the meter measurement.double
getPrice()
gets the price.getType()
Returns the service type associated with the utility bill.gets the username of the customer.gets the type of utility.void
Sets the date for the utility bill.void
setMeterMeasurement
(double parseInt) sets the ID.void
setprice()
sets the price.void
setType
(ServiceType type) Sets the service type for the utility bill.
-
Field Details
-
id
private int idThe unique identifier of the bill. -
userName
The username of the customer. -
utilityType
The type of utility. -
meterMeasurement
private double meterMeasurementThe meter measurement. -
price
private double priceThe calculated price. -
type
The service type. -
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
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
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
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
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
gets the username of the customer.Method Details
This method retrieves the username of the customer.- Returns:
- the username of the customer.
-
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.
-