Class ValueRangeFactory
java.lang.Object
org.optaplanner.core.api.domain.valuerange.ValueRangeFactory
Factory for
ValueRange
.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic CountableValueRange<BigDecimal>
createBigDecimalValueRange
(BigDecimal from, BigDecimal to) Build aCountableValueRange
of allBigDecimal
values (of a specific scale) between 2 bounds.static CountableValueRange<BigDecimal>
createBigDecimalValueRange
(BigDecimal from, BigDecimal to, BigDecimal incrementUnit) Build aCountableValueRange
of a subset ofBigDecimal
values (of a specific scale) between 2 bounds.static CountableValueRange<BigInteger>
createBigIntegerValueRange
(BigInteger from, BigInteger to) Build aCountableValueRange
of allBigInteger
values between 2 bounds.static CountableValueRange<BigInteger>
createBigIntegerValueRange
(BigInteger from, BigInteger to, BigInteger incrementUnit) Build aCountableValueRange
of a subset ofBigInteger
values between 2 bounds.static CountableValueRange<Boolean>
Build aCountableValueRange
of bothboolean
values.static ValueRange<Double>
createDoubleValueRange
(double from, double to) Build an uncountableValueRange
of alldouble
values between 2 bounds.static CountableValueRange<Integer>
createIntValueRange
(int from, int to) Build aCountableValueRange
of allint
values between 2 bounds.static CountableValueRange<Integer>
createIntValueRange
(int from, int to, int incrementUnit) Build aCountableValueRange
of a subset ofint
values between 2 bounds.static CountableValueRange<LocalDateTime>
createLocalDateTimeValueRange
(LocalDateTime from, LocalDateTime to, long incrementUnitAmount, TemporalUnit incrementUnitType) Build aCountableValueRange
of a subset ofLocalDateTime
values between 2 bounds.static CountableValueRange<LocalDate>
createLocalDateValueRange
(LocalDate from, LocalDate to, long incrementUnitAmount, TemporalUnit incrementUnitType) Build aCountableValueRange
of a subset ofLocalDate
values between 2 bounds.static CountableValueRange<LocalTime>
createLocalTimeValueRange
(LocalTime from, LocalTime to, long incrementUnitAmount, TemporalUnit incrementUnitType) Build aCountableValueRange
of a subset ofLocalTime
values between 2 bounds.static CountableValueRange<Long>
createLongValueRange
(long from, long to) Build aCountableValueRange
of alllong
values between 2 bounds.static CountableValueRange<Long>
createLongValueRange
(long from, long to, long incrementUnit) Build aCountableValueRange
of a subset oflong
values between 2 bounds.static <Temporal_ extends Temporal & Comparable<? super Temporal_>>
CountableValueRange<Temporal_>createTemporalValueRange
(Temporal_ from, Temporal_ to, long incrementUnitAmount, TemporalUnit incrementUnitType) Build aCountableValueRange
of a subset ofTemporal
values (such asLocalDate
orLocalDateTime
) between 2 bounds.
-
Constructor Details
-
ValueRangeFactory
public ValueRangeFactory()
-
-
Method Details
-
createBooleanValueRange
Build aCountableValueRange
of bothboolean
values.- Returns:
- never null
-
createIntValueRange
Build aCountableValueRange
of allint
values between 2 bounds.- Parameters:
from
- inclusive minimumto
- exclusive maximum,>= from
- Returns:
- never null
-
createIntValueRange
Build aCountableValueRange
of a subset ofint
values between 2 bounds.- Parameters:
from
- inclusive minimumto
- exclusive maximum,>= from
incrementUnit
-> 0
- Returns:
- never null
-
createLongValueRange
Build aCountableValueRange
of alllong
values between 2 bounds.- Parameters:
from
- inclusive minimumto
- exclusive maximum,>= from
- Returns:
- never null
-
createLongValueRange
public static CountableValueRange<Long> createLongValueRange(long from, long to, long incrementUnit) Build aCountableValueRange
of a subset oflong
values between 2 bounds.- Parameters:
from
- inclusive minimumto
- exclusive maximum,>= from
incrementUnit
-> 0
- Returns:
- never null
-
createDoubleValueRange
Build an uncountableValueRange
of alldouble
values between 2 bounds.- Parameters:
from
- inclusive minimumto
- exclusive maximum,>= from
- Returns:
- never null
-
createBigIntegerValueRange
public static CountableValueRange<BigInteger> createBigIntegerValueRange(BigInteger from, BigInteger to) Build aCountableValueRange
of allBigInteger
values between 2 bounds.- Parameters:
from
- inclusive minimumto
- exclusive maximum,>= from
- Returns:
- never null
-
createBigIntegerValueRange
public static CountableValueRange<BigInteger> createBigIntegerValueRange(BigInteger from, BigInteger to, BigInteger incrementUnit) Build aCountableValueRange
of a subset ofBigInteger
values between 2 bounds.- Parameters:
from
- inclusive minimumto
- exclusive maximum,>= from
incrementUnit
-> 0
- Returns:
- never null
-
createBigDecimalValueRange
public static CountableValueRange<BigDecimal> createBigDecimalValueRange(BigDecimal from, BigDecimal to) Build aCountableValueRange
of allBigDecimal
values (of a specific scale) between 2 bounds. All parameters must have the sameBigDecimal.scale()
.- Parameters:
from
- inclusive minimumto
- exclusive maximum,>= from
- Returns:
- never null
-
createBigDecimalValueRange
public static CountableValueRange<BigDecimal> createBigDecimalValueRange(BigDecimal from, BigDecimal to, BigDecimal incrementUnit) Build aCountableValueRange
of a subset ofBigDecimal
values (of a specific scale) between 2 bounds. All parameters must have the sameBigDecimal.scale()
.- Parameters:
from
- inclusive minimumto
- exclusive maximum,>= from
incrementUnit
-> 0
- Returns:
- never null
-
createLocalDateValueRange
public static CountableValueRange<LocalDate> createLocalDateValueRange(LocalDate from, LocalDate to, long incrementUnitAmount, TemporalUnit incrementUnitType) Build aCountableValueRange
of a subset ofLocalDate
values between 2 bounds.Facade for
createTemporalValueRange(Temporal, Temporal, long, TemporalUnit)
.- Parameters:
from
- never null, inclusive minimumto
- never null, exclusive maximum,>= from
incrementUnitAmount
-> 0
incrementUnitType
- never null, must besupported
-
createLocalTimeValueRange
public static CountableValueRange<LocalTime> createLocalTimeValueRange(LocalTime from, LocalTime to, long incrementUnitAmount, TemporalUnit incrementUnitType) Build aCountableValueRange
of a subset ofLocalTime
values between 2 bounds.Facade for
createTemporalValueRange(Temporal, Temporal, long, TemporalUnit)
.- Parameters:
from
- never null, inclusive minimumto
- never null, exclusive maximum,>= from
incrementUnitAmount
-> 0
incrementUnitType
- never null, must besupported
-
createLocalDateTimeValueRange
public static CountableValueRange<LocalDateTime> createLocalDateTimeValueRange(LocalDateTime from, LocalDateTime to, long incrementUnitAmount, TemporalUnit incrementUnitType) Build aCountableValueRange
of a subset ofLocalDateTime
values between 2 bounds.Facade for
createTemporalValueRange(Temporal, Temporal, long, TemporalUnit)
.- Parameters:
from
- never null, inclusive minimumto
- never null, exclusive maximum,>= from
incrementUnitAmount
-> 0
incrementUnitType
- never null, must besupported
-
createTemporalValueRange
public static <Temporal_ extends Temporal & Comparable<? super Temporal_>> CountableValueRange<Temporal_> createTemporalValueRange(Temporal_ from, Temporal_ to, long incrementUnitAmount, TemporalUnit incrementUnitType) Build aCountableValueRange
of a subset ofTemporal
values (such asLocalDate
orLocalDateTime
) between 2 bounds. All parameters must have the sameTemporalUnit
.- Parameters:
from
- never null, inclusive minimumto
- never null, exclusive maximum,>= from
incrementUnitAmount
-> 0
incrementUnitType
- never null, must besupported
byfrom
andto
-