T
- type to extract from@FunctionalInterface public interface ToDoubleNullable<T> extends Expression<T>, ToDoubleFunction<T>, ToNullable<T,Double,ToDouble<T>>, HasAbs<ToDoubleNullable<T>>, HasSign<ToByteNullable<T>>, HasSqrt<ToDoubleNullable<T>>, HasNegate<ToDoubleNullable<T>>, HasMapIfPresent<T,DoubleUnaryOperator,ToDoubleNullable<T>>, HasHash<T>, HasCompare<T>, HasCompose<T>
double
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 ToDoubleNullable<T> |
abs()
Returns a new expression that returns the absolute value of the result
of the current expression.
|
default double |
applyAsDouble(T object) |
default int |
compare(T first,
T second) |
default <V> ToDoubleNullable<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 ToDoubleNullable<T> |
mapIfPresent(DoubleUnaryOperator operator)
Returns an expression for the value of this expression mapped using the
specified mapping function.
|
default ToDoubleNullable<T> |
negate()
Returns a new expression that returns the absolute value of the result
of the current expression.
|
static <T> ToDoubleNullable<T> |
of(Function<T,Double> lambda)
Returns a typed
ToDoubleNullable<T> using the provided
lambda . |
default ToDouble<T> |
orElse(Double 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 ToDouble<T> |
orElseGet(ToDouble<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 ToDouble<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 . |
default ToByteNullable<T> |
sign()
Creates and returns an expression that returns
1 if the result of
the this expression is positive, -1 if the result of this
expression is negative and 0 if the result of this expression is
0 . |
default ToDoubleNullable<T> |
sqrt()
Creates and returns an expression that returns the square root of the
result from the current expression.
|
isNotNull, isNotNull, isNull, isNull
comparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
static <T> ToDoubleNullable<T> of(Function<T,Double> lambda)
ToDoubleNullable<T>
using the provided
lambda
.T
- type to extract fromlambda
- to convertToDoubleNullable<T>
using the provided
lambda
NullPointerException
- if the provided lambda
is
null
default ExpressionType expressionType()
Expression
expressionType
in interface Expression<T>
default double applyAsDouble(T object) throws NullPointerException
applyAsDouble
in interface ToDoubleFunction<T>
NullPointerException
default ToDouble<T> orThrow() throws NullPointerException
ToNullable
NullPointerException
if given an argument that would cause this
expression to return null
.orThrow
in interface ToNullable<T,Double,ToDouble<T>>
NullPointerException
default ToDouble<T> orElseGet(ToDouble<T> getter)
ToNullable
getter
expression if given an argument that would cause this
expression to return null
.default ToDouble<T> orElse(Double value)
ToNullable
value
if given an argument that would cause this
expression to return null
.default ToDoubleNullable<T> abs()
HasAbs
abs
in interface HasAbs<ToDoubleNullable<T>>
default ToDoubleNullable<T> negate()
HasNegate
negate
in interface HasNegate<ToDoubleNullable<T>>
default ToByteNullable<T> sign()
HasSign
1
if the result of
the this expression is positive, -1
if the result of this
expression is negative and 0
if the result of this expression is
0
.
If this expression is nullable and the result was null
, then the
result of the returned expression will also be null
.
sign
in interface HasSign<ToByteNullable<T>>
default ToDoubleNullable<T> sqrt()
HasSqrt
If this expression is nullable and the result was null
, then the
result of the returned expression will also be null
.
sqrt
in interface HasSqrt<ToDoubleNullable<T>>
default ToDoubleNullable<T> mapIfPresent(DoubleUnaryOperator operator)
HasMapIfPresent
mapIfPresent
in interface HasMapIfPresent<T,DoubleUnaryOperator,ToDoubleNullable<T>>
operator
- 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> ToDoubleNullable<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,Double>
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 © 2018 Speedment, Inc.. All rights reserved.