Class CompositeTariff

java.lang.Object
net.solarnetwork.domain.tariff.CompositeTariff
All Implemented Interfaces:
Tariff

public class CompositeTariff extends Object implements Tariff
A composite collection of tariffs that act like a single Tariff.

The getRates() will return a composite map out of all configured tariff rate maps. The tariffs and their rate maps are iterated over in their natural order, and duplicate keys are skipped.

Since:
1.71
Version:
1.0
Author:
matt
  • Constructor Details

    • CompositeTariff

      public CompositeTariff(Collection<? extends Tariff> tariffs)
      Constructor.
      Parameters:
      tariffs - the tariffs
  • Method Details

    • getRates

      public Map<String,Tariff.Rate> getRates()
      Description copied from interface: Tariff
      Get the rates that apply with this tariff.
      Specified by:
      getRates in interface Tariff
      Returns:
      the rates, as a mapping of rate IDs to associated rates, never null