E
- The type of elementpublic static interface ValueFactory.BoundedValueBuilder<E>
MutableBoundedValue
s without the hassle of
keeping track of the order of arguments.Modifier and Type | Method and Description |
---|---|
ValueFactory.BoundedValueBuilder<E> |
actualValue(E actual)
Sets the actual value.
|
MutableBoundedValue<E> |
build()
Builds a new
MutableBoundedValue . |
ValueFactory.BoundedValueBuilder<E> |
comparator(Comparator<E> comparator)
|
ValueFactory.BoundedValueBuilder<E> |
defaultValue(E defaultValue)
Sets the default value.
|
ValueFactory.BoundedValueBuilder<E> |
maximum(E max)
Sets the maximum supported value.
|
ValueFactory.BoundedValueBuilder<E> |
minimum(E min)
Sets the minimum supported value.
|
ValueFactory.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 useValueFactory.BoundedValueBuilder<E> minimum(E min)
min
- The minimum supported valueValueFactory.BoundedValueBuilder<E> maximum(E max)
max
- The maximum supported valueValueFactory.BoundedValueBuilder<E> defaultValue(E defaultValue)
defaultValue
- The default valueValueFactory.BoundedValueBuilder<E> actualValue(E actual)
defaultValue(Object)
, it should be
set.actual
- The actual 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.