Example usage for org.apache.commons.lang3 Range between

List of usage examples for org.apache.commons.lang3 Range between

Introduction

In this page you can find the example usage for org.apache.commons.lang3 Range between.

Prototype

public static <T> Range<T> between(final T fromInclusive, final T toInclusive, final Comparator<T> comparator) 

Source Link

Document

Obtains a range with the specified minimum and maximum values (both inclusive).

The range uses the specified Comparator to determine where values lie in the range.

The arguments may be passed in the order (min,max) or (max,min).

Usage

From source file:cherry.foundation.bizcal.BizYearUtil.java

public static Range<LocalDate> between(LocalDate from, LocalDate to) {
    return Range.between(from, to, new Comparator<LocalDate>() {
        @Override/* w w  w. ja  va 2 s  . c  o  m*/
        public int compare(LocalDate o1, LocalDate o2) {
            return o1.compareTo(o2);
        }
    });
}