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 extends Comparable<T>> Range<T> between(final T fromInclusive, final T toInclusive) 

Source Link

Document

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

The range uses the natural ordering of the elements 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:won.protocol.util.NeedBuilderBase.java

protected Range<Double> parseDoubleInterval(String interval, String separator) {
    String[] parts = interval.split(separator);
    if (parts.length != 2)
        throw new IllegalArgumentException("There should be exactly two parts. Found " + parts.length);

    return Range.between(Double.parseDouble(parts[0]), Double.parseDouble(parts[1]));
}

From source file:won.protocol.util.NeedBuilderBase.java

@Override
public NeedBuilder<T> setPriceLimit(final Double from, final Double to) {
    priceLimit = Range.between(from, to);
    return this;
}