E
- The type of elementpublic static interface ValueBuilder.BoundedValueBuilder<E>
MutableBoundedValue
s without the hassle of
keeping track of the order of arguments.Modifier and Type | Method and Description |
---|---|
ValueBuilder.BoundedValueBuilder<E> |
actualValue(E actual)
Sets the actual value.
|
MutableBoundedValue<E> |
build()
Builds a new
MutableBoundedValue . |
ValueBuilder.BoundedValueBuilder<E> |
comparator(Comparator<E> comparator)
|
ValueBuilder.BoundedValueBuilder<E> |
defaultValue(E defaultValue)
Sets the default value.
|
ValueBuilder.BoundedValueBuilder<E> |
maximum(E max)
Sets the maximum supported value.
|
ValueBuilder.BoundedValueBuilder<E> |
minimum(E min)
Sets the minimum supported value.
|
ValueBuilder.BoundedValueBuilder<E> comparator(Comparator<E> comparator)
E
is not Comparable
, a Comparator
is required. The builder by default will attempt to check if
the type is a Comparable
and delegate to the default
Comparable.compareTo(Object)
for comparisons. In short, the
Comparator
is only required if the element is not
Comparable
, or custom comparisons are required.comparator
- The comparator to useValueBuilder.BoundedValueBuilder<E> minimum(E min)
min
- The minimum supported valueValueBuilder.BoundedValueBuilder<E> maximum(E max)
max
- The maximum supported valueValueBuilder.BoundedValueBuilder<E> defaultValue(E defaultValue)
defaultValue
- The defualt valueValueBuilder.BoundedValueBuilder<E> actualValue(E actual)
defaultValue(Object)
, it should be
set.actual
- The actaul valueMutableBoundedValue<E> build()
MutableBoundedValue
. The requirements are
that the minimum(Object)
, maximum(Object)
,
defaultValue(Object)
are set, and if the E
is
not Comparable
, comparator(Comparator)
is set.