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