Package net.solarnetwork.domain.tariff
Class SimpleTariffRate
java.lang.Object
net.solarnetwork.domain.tariff.SimpleTariffRate
- All Implemented Interfaces:
Tariff.Rate
Simple implementation of
Tariff.Rate.- Since:
- 1.71
- Version:
- 1.0
- Author:
- matt
-
Constructor Summary
ConstructorsConstructorDescriptionSimpleTariffRate(String id, String description, BigDecimal amount) Constructor.SimpleTariffRate(String description, BigDecimal amount) Constructor. -
Method Summary
-
Constructor Details
-
SimpleTariffRate
Constructor.This method will derive the
idfrom thedescriptionviaStringUtils.simpleIdValue(String).- Parameters:
description- the descriptionamount- the amount- Throws:
IllegalArgumentException- if any argument is null
-
SimpleTariffRate
Constructor.- Parameters:
id- the IDdescription- the descriptionamount- the amount- Throws:
IllegalArgumentException- if any argument is null
-
-
Method Details
-
toString
-
getId
Description copied from interface:Tariff.RateGet a unique ID for this rate.This is meant to uniquely identify the type of rate, so the description can be localized.
- Specified by:
getIdin interfaceTariff.Rate- Returns:
- a unique ID, never null
-
getDescription
Description copied from interface:Tariff.RateGet a non-localized description of the rate.- Specified by:
getDescriptionin interfaceTariff.Rate- Returns:
- the description
-
getAmount
Description copied from interface:Tariff.RateGet the rate amount.- Specified by:
getAmountin interfaceTariff.Rate- Returns:
- the amount, never null
-
hashCode
public int hashCode() -
equals
-