Class InDateRangeDual
- java.lang.Object
-
- uk.gov.gchq.koryphe.predicate.KoryphePredicate<TUPLE>
-
- uk.gov.gchq.koryphe.tuple.predicate.KoryphePredicateN<Tuple2<T,U>>
-
- uk.gov.gchq.koryphe.tuple.predicate.KoryphePredicate2<Comparable<T>,Comparable<T>>
-
- uk.gov.gchq.koryphe.impl.predicate.range.AbstractInTimeRangeDual<Date>
-
- uk.gov.gchq.koryphe.impl.predicate.range.InDateRangeDual
-
- All Implemented Interfaces:
Predicate<Tuple2<Comparable<Date>,Comparable<Date>>>
public class InDateRangeDual extends AbstractInTimeRangeDual<Date>
An
InDateRangeDual
is aPredicate
that tests if a startComparable
and endComparable
is within a provided range [start, end]. Specifically the startComparable
has to be greater than the start bound and the endComparable
has to be less than the end bound. By default the range is inclusive, you can toggle this using the startInclusive and endInclusive booleans.If the start is not set then this will be treated as unbounded. Similarly with the end.
If the test value is null then the predicate will return false.
This range predicate takes 2 values to test, if you want to test a single value lies within a range then you can use the
InDateRange
predicate.The range can also be configured using time offsets from the current system time or a provided start/end time. You can set the start and end offsets using startOffset and endOffset. By default the offset is measured in Days, this can be changed to DAY, HOUR, MINUTE, SECOND and MILLISECOND using the offsetUnit field.
At the point when test is called on the class the current system time is used to calculate the start and end values based on: System.currentTimeMillis() + offset.
You can configure the start and end time strings using one of the following formats:
- timestamp in milliseconds
- yyyy/MM
- yyyy/MM/dd
- yyyy/MM/dd HH
- yyyy/MM/dd HH:mm
- yyyy/MM/dd HH:mm:ss
- See Also:
InDateRangeDual.Builder
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
InDateRangeDual.Builder
-
Nested classes/interfaces inherited from class uk.gov.gchq.koryphe.impl.predicate.range.AbstractInTimeRangeDual
AbstractInTimeRangeDual.BaseBuilder<B extends AbstractInTimeRangeDual.BaseBuilder<B,R,T>,R extends AbstractInTimeRangeDual<T>,T extends Comparable<T>>
-
-
Constructor Summary
Constructors Constructor Description InDateRangeDual()
-
Method Summary
-
Methods inherited from class uk.gov.gchq.koryphe.impl.predicate.range.AbstractInTimeRangeDual
equals, getEnd, getEndOffset, getOffsetUnit, getStart, getStartOffset, getTimeUnit, getTimeZone, getTimeZoneId, hashCode, initialise, isEndFullyContained, isEndInclusive, isStartFullyContained, isStartInclusive, test, toString
-
Methods inherited from class uk.gov.gchq.koryphe.tuple.predicate.KoryphePredicateN
test
-
-