Type - The Type of the bound. Has to be Comparable.public interface Bounded<Type extends Comparable<Type>>
| Modifier and Type | Method and Description |
|---|---|
default void |
assertIfValueInRange(Type value)
Asserts whether the given value is larger than the lower bound and
smaller than the upper bound specified for this object.
|
Type |
getLowerBound()
Returns the lower bound specified for this object.
|
Type |
getUpperBound()
Returns the upper bound specified for this object.
|
default boolean |
isInRange(Type value)
Checks whether the given value is larger than the lower bound and smaller
than the upper bound specified for this object.
|
Type getLowerBound()
Type getUpperBound()
default boolean isInRange(Type value)
value - The value to be checked.true if the constraints are met.default void assertIfValueInRange(Type value)
IllegalArgumentException will be thrown.value - The value to be asserted.IllegalArgumentException - if the constraints are not met.Copyright © 2017. All rights reserved.