Package net.solarnetwork.domain.tariff
Class SimpleTemporalRangesTariffEvaluator
java.lang.Object
net.solarnetwork.service.support.BasicIdentifiable
net.solarnetwork.domain.tariff.SimpleTemporalRangesTariffEvaluator
- All Implemented Interfaces:
TemporalRangesTariffEvaluator,Identifiable
public final class SimpleTemporalRangesTariffEvaluator
extends BasicIdentifiable
implements TemporalRangesTariffEvaluator
Simple implementation of
TemporalRangesTariffEvaluator.
Each of the fields in the given rule are compared to the given date. If a
range exists for a given field, and the associated value of that field in the
given date is not within that range, false is returned. All ranges
are treated as inclusive, except the MINUTE_OF_DAY range whose
maximum value is treated as an exclusive value.
- Since:
- 1.71
- Version:
- 1.0
- Author:
- matt
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final TemporalRangesTariffEvaluatorA static default instance.Fields inherited from interface net.solarnetwork.service.Identifiable
GROUP_UID_PROPERTY, UID_PROPERTY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanapplies(TemporalRangesTariff rule, LocalDateTime dateTime, Map<String, ?> parameters) Test if a rule applies to a given date and set of parameters.Methods inherited from class net.solarnetwork.service.support.BasicIdentifiable
basicIdentifiableMetadataSettings, basicIdentifiableSettings, basicIdentifiableSettings, basicIdentifiableSettings, doubleMetadataValue, getDisplayName, getGroupUid, getGroupUID, getMessageSource, getMetadata, getMetadataCount, getUid, getUID, integerMetadataValue, metadataValue, numberMetadataValue, saveMetadataValue, saveMetadataValue, setDisplayName, setGroupUid, setGroupUID, setMessageSource, setMetadata, setMetadataCount, setUid, setUID, smartMetadataValueMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.solarnetwork.service.Identifiable
getDisplayName, getGroupUid, getUid
-
Field Details
-
DEFAULT_EVALUATOR
A static default instance.
-
-
Constructor Details
-
SimpleTemporalRangesTariffEvaluator
public SimpleTemporalRangesTariffEvaluator()
-
-
Method Details
-
applies
Description copied from interface:TemporalRangesTariffEvaluatorTest if a rule applies to a given date and set of parameters.- Specified by:
appliesin interfaceTemporalRangesTariffEvaluator- Parameters:
rule- the ruledateTime- the dateparameters- the parameters- Returns:
- true if the tariff applies
-