Class SimpleTemporalTariffSchedule

java.lang.Object
net.solarnetwork.domain.tariff.SimpleTemporalTariffSchedule
All Implemented Interfaces:
TariffSchedule

public class SimpleTemporalTariffSchedule extends Object implements TariffSchedule
A simple time-based tariff schedule based on a list of time-based rules.
Since:
1.71
Version:
1.0
Author:
matt
  • Field Details

    • DEFAULT_EVALUATOR

      public static final TemporalRangesTariffEvaluator DEFAULT_EVALUATOR
      The evaluator default value.
    • DEFAULT_FIRST_MATCH_ONLY

      public static final boolean DEFAULT_FIRST_MATCH_ONLY
      The firstMatchOnly default value.
      See Also:
  • Constructor Details

  • Method Details

    • resolveTariff

      public Tariff resolveTariff(LocalDateTime dateTime, Map<String,?> parameters)
      Description copied from interface: TariffSchedule
      Resolve a tariff.
      Specified by:
      resolveTariff in interface TariffSchedule
      Parameters:
      dateTime - the date to resolve a tariff for
      parameters - optional parameters
      Returns:
      the tariff, or null if no tariff applies
    • isFirstMatchOnly

      public boolean isFirstMatchOnly()
      Get the first-match-only flag.
      Returns:
      true if only the first tariff rule that matches should be returned, false to return a composite rule of all matches; defaults to DEFAULT_FIRST_MATCH_ONLY
    • setFirstMatchOnly

      public void setFirstMatchOnly(boolean firstMatchOnly)
      Set the first-match-only flag.
      Parameters:
      firstMatchOnly - true if only the first tariff rule that matches should be returned
    • getRules

      public List<TemporalRangesTariff> getRules()
      Get the configured rules.
      Returns:
      the rules