Package Model

Enum Class ServiceType

All Implemented Interfaces:
Serializable, Comparable<ServiceType>, Constable

public enum ServiceType extends Enum<ServiceType>
The `ServiceType` enum represents various types of utility services, each with its associated unit charges and service charges.
  • Enum Constant Details

    • ELECTRICITY

      public static final ServiceType ELECTRICITY
      ELECTRICITY service type. Unit Charges: $0.12 per unit Service Charges: $10.0
    • GAS

      public static final ServiceType GAS
      GAS service type. Unit Charges: $0.08 per unit Service Charges: $15.0
    • WATER

      public static final ServiceType WATER
      WATER service type. Unit Charges: $0.05 per unit Service Charges: $20.0
  • Field Details

    • unitCharges

      private double unitCharges
    • serviceCharges

      private double serviceCharges
  • Constructor Details

    • ServiceType

      private ServiceType(double unitCharges, double serviceCharges)
      Constructs a `ServiceType` with the specified unit charges and service charges.
      Parameters:
      unitCharges - The unit charges for the service type.
      serviceCharges - The service charges for the service type.
  • Method Details

    • values

      public static ServiceType[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static ServiceType valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getUnitCharges

      public double getUnitCharges()
      Get the unit charges for this service type.
      Returns:
      The unit charges.
    • setUnitCharges

      public void setUnitCharges(double unitCharges)
      Set the unit charges for this service type.
      Parameters:
      unitCharges - The unit charges to set.
    • getServiceCharges

      public double getServiceCharges()
      Get the service charges for this service type.
      Returns:
      The service charges.
    • setServiceCharges

      public void setServiceCharges(double serviceCharges)
      Set the service charges for this service type.
      Parameters:
      serviceCharges - The service charges to set.