T - type to extract from@FunctionalInterface public interface ToBigDecimal<T> extends Expression<T>, Function<T,BigDecimal>, HasAsInt<T>, HasAsLong<T>, HasAsDouble<T>, HasAbs<ToBigDecimal<T>>, HasSign<ToByte<T>>, HasSqrt<ToDouble<T>>, HasNegate<ToBigDecimal<T>>, HasPow<T>, HasPlus<T>, HasMinus<T>, HasMultiply<T>, HasDivide<T>, HasMap<T,UnaryOperator<BigDecimal>,ToBigDecimal<T>>, HasMapToDouble<T,ToDoubleFunction<BigDecimal>>, HasHash<T>, HasCompare<T>, HasCompose<T>
BigDecimal value.
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 ToBigDecimal<T> |
abs()
Returns a new expression that returns the absolute value of the result
of the current expression.
|
BigDecimal |
apply(T object) |
default ToDouble<T> |
asDouble()
Returns an expression that casts the result of the current expression
into a
double. |
default ToInt<T> |
asInt()
Returns an expression that casts the result of the current expression
into an
int. |
default ToLong<T> |
asLong()
Returns an expression that casts the result of the current expression
into a
long. |
default int |
compare(T first,
T second) |
default <V> ToBigDecimalNullable<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 ToDouble<T> |
divide(double divisor)
Creates and returns an expression that returns the quotient of the result
from the current expression and the divisor.
|
default ToDouble<T> |
divide(int divisor)
Creates and returns an expression that returns the quotient of
the result from the current expression and the divisor.
|
default ToDouble<T> |
divide(long divisor)
Creates and returns an expression that returns the quotient of the result
from the current expression and the divisor.
|
default ToDouble<T> |
divide(ToDouble<T> divisor)
Creates and returns an expression that returns the quotient of the result
from the current expression and the divisor.
|
default ToDouble<T> |
divide(ToInt<T> divisor)
Creates and returns an expression that returns the quotient of the result
from the current expression and the divisor.
|
default ToDouble<T> |
divide(ToLong<T> divisor)
Creates and returns an expression that returns the quotient of the result
from the current expression and the divisor.
|
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 ToBigDecimal<T> |
map(UnaryOperator<BigDecimal> mapper)
Returns an expression for the value of this expression mapped using the
specified mapping function.
|
default ToDouble<T> |
mapToDouble(ToDoubleFunction<BigDecimal> mapper)
Maps the result of this expression into a
double by passing it to
the specified mapper, producing a new expression that implements
ToDouble. |
default ToDouble<T> |
minus(byte other)
Creates and returns an expression that returns the difference of the
result from the current expression and the other term.
|
default ToDouble<T> |
minus(double other)
Creates and returns an expression that returns the difference of the
result from the current expression and the other term.
|
default ToDouble<T> |
minus(int other)
Creates and returns an expression that returns the difference of the
result from the current expression and the other term.
|
default ToDouble<T> |
minus(long other)
Creates and returns an expression that returns the difference of the
result from the current expression and the other term.
|
default ToDouble<T> |
minus(ToByte<T> other)
Creates and returns an expression that returns the difference of the
result from the current expression and the other term.
|
default ToDouble<T> |
minus(ToDouble<T> other)
Creates and returns an expression that returns the difference of the
result from the current expression and the other term.
|
default ToDouble<T> |
minus(ToInt<T> other)
Creates and returns an expression that returns the difference of the
result from the current expression and the other term.
|
default ToDouble<T> |
minus(ToLong<T> other)
Creates and returns an expression that returns the difference of the
result from the current expression and the other term.
|
default ToDouble<T> |
multiply(byte other)
Creates and returns an expression that returns the product of the result
from the current expression and the other factor.
|
default ToDouble<T> |
multiply(double other)
Creates and returns an expression that returns the product of the result
from the current expression and the other factor.
|
default ToDouble<T> |
multiply(int other)
Creates and returns an expression that returns the product of the result
from the current expression and the other factor.
|
default ToDouble<T> |
multiply(long other)
Creates and returns an expression that returns the product of the result
from the current expression and the other factor.
|
default ToDouble<T> |
multiply(ToByte<T> other)
Creates and returns an expression that returns the product of the result
from the current expression and the other factor.
|
default ToDouble<T> |
multiply(ToDouble<T> other)
Creates and returns an expression that returns the product of the result
from the current expression and the other factor.
|
default ToDouble<T> |
multiply(ToInt<T> other)
Creates and returns an expression that returns the product of the result
from the current expression and the other factor.
|
default ToDouble<T> |
multiply(ToLong<T> other)
Creates and returns an expression that returns the product of the result
from the current expression and the other factor.
|
default ToBigDecimal<T> |
negate()
Returns a new expression that returns the absolute value of the result
of the current expression.
|
static <T> ToBigDecimal<T> |
of(Function<T,BigDecimal> lambda)
Returns a typed
ToBigDecimal<T> using the provided
lambda. |
default ToDouble<T> |
plus(byte other)
Creates and returns an expression that returns the sum of the result from
the current expression and the other term.
|
default ToDouble<T> |
plus(double other)
Creates and returns an expression that returns the sum of the result from
the current expression and the other term.
|
default ToDouble<T> |
plus(int other)
Creates and returns an expression that returns the sum of the result from
the current expression and the other term.
|
default ToDouble<T> |
plus(long other)
Creates and returns an expression that returns the sum of the result from
the current expression and the other term.
|
default ToDouble<T> |
plus(ToByte<T> other)
Creates and returns an expression that returns the sum of the result from
the current expression and the other term.
|
default ToDouble<T> |
plus(ToDouble<T> other)
Creates and returns an expression that returns the sum of the result from
the current expression and the other term.
|
default ToDouble<T> |
plus(ToInt<T> other)
Creates and returns an expression that returns the sum of the result from
the current expression and the other term.
|
default ToDouble<T> |
plus(ToLong<T> other)
Creates and returns an expression that returns the sum of the result from
the current expression and the other term.
|
default ToDouble<T> |
pow(double power)
Creates and returns an expression that returns the exponential power of
the result from the current expression.
|
default ToDouble<T> |
pow(int power)
Creates and returns an expression that returns the exponential power of
the result from the current expression.
|
default ToDouble<T> |
pow(ToDouble<T> power)
Creates and returns an expression that returns the exponential power of
the result from the current expression.
|
default ToDouble<T> |
pow(ToInt<T> power)
Creates and returns an expression that returns the exponential power of
the result from the current expression.
|
default ToByte<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 ToDouble<T> |
sqrt()
Creates and returns an expression that returns the square root of the
result from the current expression.
|
comparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLongstatic <T> ToBigDecimal<T> of(Function<T,BigDecimal> lambda)
ToBigDecimal<T> using the provided
lambda.T - type to extract fromlambda - to convertToBigDecimal<T> using the provided lambdaNullPointerException - if the provided lambda is
nullBigDecimal apply(T object)
apply in interface Function<T,BigDecimal>default ExpressionType expressionType()
ExpressionexpressionType in interface Expression<T>default ToDouble<T> asDouble()
HasAsDoubledouble.asDouble in interface HasAsDouble<T>default ToInt<T> asInt()
HasAsIntint.default ToLong<T> asLong()
HasAsLonglong.default ToBigDecimal<T> abs()
HasAbsabs in interface HasAbs<ToBigDecimal<T>>default ToByte<T> sign()
HasSign1 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.
default ToDouble<T> sqrt()
HasSqrt
If this expression is nullable and the result was null, then the
result of the returned expression will also be null.
default ToBigDecimal<T> negate()
HasNegatenegate in interface HasNegate<ToBigDecimal<T>>default ToDouble<T> pow(int power)
HasPow-3 and the power was set to 2,
then the result of the returned expression would be 9.
If this expression is nullable and the result was null, then the
result of the returned expression will also be null.
default ToDouble<T> pow(double power)
HasPow-3 and the power was set to 2,
then the result of the returned expression would be 9.
If this expression is nullable and the result was null, then the
result of the returned expression will also be null.
default ToDouble<T> pow(ToInt<T> power)
HasPow-3 and the power was set to 2,
then the result of the returned expression would be 9.
If this expression is nullable and the result was null, then the
result of the returned expression will also be null.
default ToDouble<T> pow(ToDouble<T> power)
HasPow-3 and the power was set to 2,
then the result of the returned expression would be 9.
If this expression is nullable and the result was null, then the
result of the returned expression will also be null.
default ToDouble<T> plus(byte other)
HasPlus9 and the other term was set to
3, then the result of the returned expression would be 12.
If this expression is nullable and the result was null, then the
result of the returned expression will also be null.
default ToDouble<T> plus(ToByte<T> other)
HasPlus9 and the other term was set to
3, then the result of the returned expression would be 12.
If this expression is nullable and the result was null, then the
result of the returned expression will also be null.
default ToDouble<T> plus(int other)
HasPlus9 and the other term was set to
3, then the result of the returned expression would be 12.
If this expression is nullable and the result was null, then the
result of the returned expression will also be null.
default ToDouble<T> plus(ToInt<T> other)
HasPlus9 and the other term was set to
3, then the result of the returned expression would be 12.
If this expression is nullable and the result was null, then the
result of the returned expression will also be null.
default ToDouble<T> plus(long other)
HasPlus9 and the other term was set to
3, then the result of the returned expression would be 12.
If this expression is nullable and the result was null, then the
result of the returned expression will also be null.
default ToDouble<T> plus(ToLong<T> other)
HasPlus9 and the other term was set to
3, then the result of the returned expression would be 12.
If this expression is nullable and the result was null, then the
result of the returned expression will also be null.
default ToDouble<T> plus(double other)
HasPlus9 and the other term was set to
3, then the result of the returned expression would be 12.
If this expression is nullable and the result was null, then the
result of the returned expression will also be null.
default ToDouble<T> plus(ToDouble<T> other)
HasPlus9 and the other term was set to
3, then the result of the returned expression would be 12.
If this expression is nullable and the result was null, then the
result of the returned expression will also be null.
default ToDouble<T> minus(byte other)
HasMinus9 and the other term was
set to 3, then the result of the returned expression would be
6.
If this expression is nullable and the result was null, then the
result of the returned expression will also be null.
default ToDouble<T> minus(ToByte<T> other)
HasMinus9 and the other term was
set to 3, then the result of the returned expression would be
6.
If this expression is nullable and the result was null, then the
result of the returned expression will also be null.
default ToDouble<T> minus(int other)
HasMinus9 and the other term was
set to 3, then the result of the returned expression would be
6.
If this expression is nullable and the result was null, then the
result of the returned expression will also be null.
default ToDouble<T> minus(ToInt<T> other)
HasMinus9 and the other term was
set to 3, then the result of the returned expression would be
6.
If this expression is nullable and the result was null, then the
result of the returned expression will also be null.
default ToDouble<T> minus(long other)
HasMinus9 and the other term was
set to 3, then the result of the returned expression would be
6.
If this expression is nullable and the result was null, then the
result of the returned expression will also be null.
default ToDouble<T> minus(ToLong<T> other)
HasMinus9 and the other term was
set to 3, then the result of the returned expression would be
6.
If this expression is nullable and the result was null, then the
result of the returned expression will also be null.
default ToDouble<T> minus(double other)
HasMinus9 and the other term was
set to 3, then the result of the returned expression would be
6.
If this expression is nullable and the result was null, then the
result of the returned expression will also be null.
default ToDouble<T> minus(ToDouble<T> other)
HasMinus9 and the other term was
set to 3, then the result of the returned expression would be
6.
If this expression is nullable and the result was null, then the
result of the returned expression will also be null.
default ToDouble<T> multiply(byte other)
HasMultiply9 and the factor was set to
3, then the result of the returned expression would be 27.
If this expression is nullable and the result was null, then the
result of the returned expression will also be null.
multiply in interface HasMultiply<T>other - the other factor used for the multiplicationdefault ToDouble<T> multiply(ToByte<T> other)
HasMultiply9 and the factor was set to
3, then the result of the returned expression would be 27.
If this expression is nullable and the result was null, then the
result of the returned expression will also be null.
multiply in interface HasMultiply<T>other - the other factor used for the multiplicationdefault ToDouble<T> multiply(int other)
HasMultiply9 and the factor was set to
3, then the result of the returned expression would be 27.
If this expression is nullable and the result was null, then the
result of the returned expression will also be null.
multiply in interface HasMultiply<T>other - the other factor used for the multiplicationdefault ToDouble<T> multiply(ToInt<T> other)
HasMultiply9 and the factor was set to
3, then the result of the returned expression would be 27.
If this expression is nullable and the result was null, then the
result of the returned expression will also be null.
multiply in interface HasMultiply<T>other - the other factor used for the multiplicationdefault ToDouble<T> multiply(long other)
HasMultiply9 and the factor was set to
3, then the result of the returned expression would be 27.
If this expression is nullable and the result was null, then the
result of the returned expression will also be null.
multiply in interface HasMultiply<T>other - the other factor used for the multiplicationdefault ToDouble<T> multiply(ToLong<T> other)
HasMultiply9 and the factor was set to
3, then the result of the returned expression would be 27.
If this expression is nullable and the result was null, then the
result of the returned expression will also be null.
multiply in interface HasMultiply<T>other - the other factor used for the multiplicationdefault ToDouble<T> multiply(double other)
HasMultiply9 and the factor was set to
3, then the result of the returned expression would be 27.
If this expression is nullable and the result was null, then the
result of the returned expression will also be null.
multiply in interface HasMultiply<T>other - the other factor used for the multiplicationdefault ToDouble<T> multiply(ToDouble<T> other)
HasMultiply9 and the factor was set to
3, then the result of the returned expression would be 27.
If this expression is nullable and the result was null, then the
result of the returned expression will also be null.
multiply in interface HasMultiply<T>other - the other factor used for the multiplicationdefault ToDouble<T> divide(int divisor)
HasDivide9 and the divisor was set to 3,
then the result of the returned expression would be 3.
If this expression is nullable and the result was null, then the
result of the returned expression will also be null.
default ToDouble<T> divide(ToInt<T> divisor)
HasDivide9 and the divisor was set to
3, then the result of the returned expression would be 3.
If this expression is nullable and the result was null, then the
result of the returned expression will also be null.
default ToDouble<T> divide(long divisor)
HasDivide9 and the divisor was set to
3, then the result of the returned expression would be 3.
If this expression is nullable and the result was null, then the
result of the returned expression will also be null.
default ToDouble<T> divide(ToLong<T> divisor)
HasDivide9 and the divisor was set to
3, then the result of the returned expression would be 3.
If this expression is nullable and the result was null, then the
result of the returned expression will also be null.
default ToDouble<T> divide(double divisor)
HasDivide9 and the divisor was set to
3, then the result of the returned expression would be 3.
If this expression is nullable and the result was null, then the
result of the returned expression will also be null.
default ToDouble<T> divide(ToDouble<T> divisor)
HasDivide9 and the divisor was set to
3, then the result of the returned expression would be 3.
If this expression is nullable and the result was null, then the
result of the returned expression will also be null.
default ToBigDecimal<T> map(UnaryOperator<BigDecimal> mapper)
HasMapmap in interface HasMap<T,UnaryOperator<BigDecimal>,ToBigDecimal<T>>mapper - the mapping functiondefault ToDouble<T> mapToDouble(ToDoubleFunction<BigDecimal> mapper)
HasMapToDoubledouble by passing it to
the specified mapper, producing a new expression that implements
ToDouble.mapToDouble in interface HasMapToDouble<T,ToDoubleFunction<BigDecimal>>mapper - the mapper to use on the result of this expressiondefault long hash(T object)
HasHashdefault int compare(T first, T second)
compare in interface Comparator<T>compare in interface HasCompare<T>default <V> ToBigDecimalNullable<V> compose(Function<? super V,? extends T> before)
HasComposebefore
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,BigDecimal>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.