public class DateAttributePredicate extends AbstractAttributePredicate
| Modifier and Type | Field and Description |
|---|---|
private String |
attributeName
Name of attribute to query for.
|
private DateTimeFormatter |
dateTimeFormatter
Formatter used to parse string-based date attribute values.
|
private org.slf4j.Logger |
log
Class logger.
|
private boolean |
resultIfMissing
Result of predicate if attribute is missing or has no values.
|
private Duration |
systemTimeOffset
Offset from system time used for date comparisons.
|
| Constructor and Description |
|---|
DateAttributePredicate(String attribute)
Create a new instance that performs date comparisons against the given attribute
using ISO date/time format parser by default.
|
DateAttributePredicate(String attribute,
DateTimeFormatter formatter)
Create a new instance that performs date comparisons against the given attribute
using the given date parser.
|
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
allowNullAttributeContext()
Get the result of the predicate in the case the attribute context is null.
|
protected boolean |
hasMatch(Map<String,IdPAttribute> attributeMap)
Abstract implementation of the condition to evaluate.
|
void |
setResultIfMissing(boolean flag)
Set the result to return if the attribute to check is missing or has no values.
|
void |
setSystemTimeOffset(Duration offset)
Set the system time offset, which affects the reference date for comparisons.
|
apply, setAttributeContextLookupStrategy, setUseUnfilteredAttributes@Nonnull private final org.slf4j.Logger log
@Nonnull private final DateTimeFormatter dateTimeFormatter
@Nonnull private Duration systemTimeOffset
private boolean resultIfMissing
public DateAttributePredicate(@Nonnull@NotEmpty@ParameterName(name="attribute") String attribute)
attribute - Attribute name that provides candidate date values to test.public DateAttributePredicate(@Nonnull@NotEmpty@ParameterName(name="attribute") String attribute, @Nonnull@ParameterName(name="formatter") DateTimeFormatter formatter)
attribute - Attribute name that provides candidate date values to test.formatter - Date/time parser.public void setSystemTimeOffset(@Nonnull Duration offset)
offset - System time offset. A negative value decreases the target date (sooner);
a positive value increases the target date (later).public void setResultIfMissing(boolean flag)
flag - flag to setprotected boolean allowNullAttributeContext()
allowNullAttributeContext in class AbstractAttributePredicateprotected boolean hasMatch(@Nonnull@NonnullElements Map<String,IdPAttribute> attributeMap)
hasMatch in class AbstractAttributePredicateattributeMap - the attributes to evaluateCopyright © 1999–2017 Shibboleth Consortium. All rights reserved.