Class InTimeRangeDual

  • All Implemented Interfaces:
    Predicate<Tuple2<Comparable<Long>,​Comparable<Long>>>

    public class InTimeRangeDual
    extends AbstractInTimeRangeDual<Long>

    An InTimeRangeDual is a Predicate that tests if a start Comparable and end Comparable is within a provided range [start, end]. Specifically the start Comparable has to be greater than the start bound and the end Comparable 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 InTimeRange 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.

    By default checks are carried out assuming the data will be in milliseconds. If this is not the case you can change the time unit using the timeUnit property.

    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
    You can use a space, '-', '/', '_', ':', '|', or '.' to separate the parts.
    See Also:
    InTimeRangeDual.Builder
    • Constructor Detail

      • InTimeRangeDual

        public InTimeRangeDual()