Example usage for com.google.common.collect Ranges downTo

List of usage examples for com.google.common.collect Ranges downTo

Introduction

In this page you can find the example usage for com.google.common.collect Ranges downTo.

Prototype

public static <C extends Comparable<?>> Range<C> downTo(C paramC, BoundType paramBoundType)

Source Link

Usage

From source file:org.eclipse.smarthome.transform.scale.internal.ScaleTransformationService.java

private Range<Double> getRange(BoundType lowBoundType, BoundType highBoundType, Double lowValue,
        Double highValue) {//  w  w w .j  av a2s  .c  o m

    if (lowValue == null && highValue == null) {
        return Ranges.all();
    } else if (lowValue == null) {
        return Ranges.upTo(highValue, highBoundType);
    } else if (highValue == null) {
        return Ranges.downTo(lowValue, lowBoundType);
    } else {
        return Ranges.range(lowValue, lowBoundType, highValue, highBoundType);
    }

}