T
- type to extract from@FunctionalInterface public interface ToBooleanNullable<T> extends Expression<T>, com.speedment.common.function.ToBooleanFunction<T>, ToNullable<T,Boolean,ToBoolean<T>>, HasMapToDoubleIfPresent<T,com.speedment.common.function.BooleanToDoubleFunction>, HasMapIfPresent<T,com.speedment.common.function.BooleanUnaryOperator,ToBooleanNullable<T>>, HasHash<T>, HasCompare<T>, HasCompose<T>
boolean
value, or
null
. This expression can be implemented using a lambda, or it can be
a result of another operation. It has additional methods for operating on it.Function
Modifier and Type | Method and Description |
---|---|
default boolean |
applyAsBoolean(T object)
Applies this function to the given argument.
|
default int |
compare(T first,
T second) |
default <V> ToBooleanNullable<V> |
compose(Function<? super V,? extends T> before)
Returns a composed expression that first applies the
before
function to its input, and then applies this function to the result. |
default ExpressionType |
expressionType()
Returns the expression type of this expression.
|
default long |
hash(T object)
Hash the specified object into a 64-bit hash.
|
default ToBooleanNullable<T> |
mapIfPresent(com.speedment.common.function.BooleanUnaryOperator mapper)
Returns an expression for the value of this expression mapped using the
specified mapping function.
|
default ToDoubleNullable<T> |
mapToDoubleIfPresent(com.speedment.common.function.BooleanToDoubleFunction mapper)
Maps the result of this expression into a
double by passing it to
the specified mapper , producing a new expression that implements
ToDouble . |
static <T> ToBooleanNullable<T> |
of(Function<T,Boolean> lambda)
Returns a typed
ToBooleanNullable<T> using the provided
lambda . |
default ToBoolean<T> |
orElse(Boolean value)
Returns an equivalent expression as this, except that it will return
the
value if given an argument that would cause this
expression to return null . |
default ToBoolean<T> |
orElseGet(ToBoolean<T> getter)
Returns an equivalent expression as this, except that it will return
the
getter expression if given an argument that would cause this
expression to return null . |
default ToBoolean<T> |
orThrow()
Returns an equivalent expression as this, except that it will throw a
NullPointerException if given an argument that would cause this
expression to return null . |
isNotNull, isNotNull, isNull, isNull
comparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
static <T> ToBooleanNullable<T> of(Function<T,Boolean> lambda)
ToBooleanNullable<T>
using the provided
lambda
.T
- type to extract fromlambda
- to convertToBooleanNullable<T>
using the provided
lambda
NullPointerException
- if the provided lambda
is
null
default ExpressionType expressionType()
Expression
expressionType
in interface Expression<T>
default boolean applyAsBoolean(T object) throws NullPointerException
com.speedment.common.function.ToBooleanFunction
applyAsBoolean
in interface com.speedment.common.function.ToBooleanFunction<T>
object
- the argumentNullPointerException
default ToBoolean<T> orThrow() throws NullPointerException
ToNullable
NullPointerException
if given an argument that would cause this
expression to return null
.orThrow
in interface ToNullable<T,Boolean,ToBoolean<T>>
NullPointerException
default ToBoolean<T> orElseGet(ToBoolean<T> getter)
ToNullable
getter
expression if given an argument that would cause this
expression to return null
.default ToBoolean<T> orElse(Boolean value)
ToNullable
value
if given an argument that would cause this
expression to return null
.default ToDoubleNullable<T> mapToDoubleIfPresent(com.speedment.common.function.BooleanToDoubleFunction mapper)
HasMapToDoubleIfPresent
double
by passing it to
the specified mapper
, producing a new expression that implements
ToDouble
. If this expression would have evaluated to
null
, then the new expression will as well.mapToDoubleIfPresent
in interface HasMapToDoubleIfPresent<T,com.speedment.common.function.BooleanToDoubleFunction>
mapper
- the mapper to use on the result of this expressiondefault ToBooleanNullable<T> mapIfPresent(com.speedment.common.function.BooleanUnaryOperator mapper)
HasMapIfPresent
mapIfPresent
in interface HasMapIfPresent<T,com.speedment.common.function.BooleanUnaryOperator,ToBooleanNullable<T>>
mapper
- the mapping functiondefault long hash(T object)
HasHash
default int compare(T first, T second)
compare
in interface Comparator<T>
compare
in interface HasCompare<T>
default <V> ToBooleanNullable<V> compose(Function<? super V,? extends T> before)
HasCompose
before
function to its input, and then applies this function to the result.
If evaluation of either function throws an exception, it is relayed to
the caller of the composed function.compose
in interface Function<T,Boolean>
compose
in interface HasCompose<T>
V
- the type of input to the before
function, and to the
composed expressionbefore
- the function to apply before this function is appliedbefore
function and then applies this functionCopyright © 2019 Speedment, Inc.. All rights reserved.