Package com.speedment.runtime.compute
Interface ToBigDecimalNullable<T>
-
- Type Parameters:
T- type to extract from
- All Superinterfaces:
Comparator<T>,Expression<T>,Function<T,BigDecimal>,HasCompare<T>,HasCompose<T>,HasHash<T>,ToNullable<T,BigDecimal,ToBigDecimal<T>>
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface ToBigDecimalNullable<T> extends Expression<T>, ToNullable<T,BigDecimal,ToBigDecimal<T>>, HasHash<T>, HasCompare<T>, HasCompose<T>
Expression that given an entity returns a nullableBigDecimalvalue. 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.- Since:
- 3.1.0
- Author:
- Per Minborg
- See Also:
Function
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description BigDecimalapply(T object)default intcompare(T first, T second)default <V> ToBigDecimalNullable<V>compose(Function<? super V,? extends T> before)Returns a composed expression that first applies thebeforefunction to its input, and then applies this function to the result.default ExpressionTypeexpressionType()Returns the expression type of this expression.default longhash(T object)Hash the specified object into a 64-bit hash.static <T> ToBigDecimalNullable<T>of(Function<T,BigDecimal> lambda)Returns a typedToBigDecimalNullable<T>using the providedlambda.default ToBigDecimal<T>orElse(BigDecimal value)Returns an equivalent expression as this, except that it will return thevalueif given an argument that would cause this expression to returnnull.default ToBigDecimal<T>orElseGet(ToBigDecimal<T> getter)Returns an equivalent expression as this, except that it will return thegetterexpression if given an argument that would cause this expression to returnnull.default ToBigDecimal<T>orThrow()Returns an equivalent expression as this, except that it will throw aNullPointerExceptionif given an argument that would cause this expression to returnnull.-
Methods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Methods inherited from interface com.speedment.runtime.compute.trait.ToNullable
isNotNull, isNotNull, isNull, isNull
-
-
-
-
Method Detail
-
of
static <T> ToBigDecimalNullable<T> of(Function<T,BigDecimal> lambda)
Returns a typedToBigDecimalNullable<T>using the providedlambda.- Type Parameters:
T- type to extract from- Parameters:
lambda- to convert- Returns:
- a typed
ToBigDecimalNullable<T>using the providedlambda - Throws:
NullPointerException- if the providedlambdaisnull
-
apply
BigDecimal apply(T object)
- Specified by:
applyin interfaceFunction<T,BigDecimal>
-
expressionType
default ExpressionType expressionType()
Description copied from interface:ExpressionReturns the expression type of this expression. It should be safe to cast this instance into the corresponding interface.- Specified by:
expressionTypein interfaceExpression<T>- Returns:
- the expression type
-
orThrow
default ToBigDecimal<T> orThrow()
Description copied from interface:ToNullableReturns an equivalent expression as this, except that it will throw aNullPointerExceptionif given an argument that would cause this expression to returnnull.- Specified by:
orThrowin interfaceToNullable<T,BigDecimal,ToBigDecimal<T>>- Returns:
- the expression if present
-
orElseGet
default ToBigDecimal<T> orElseGet(ToBigDecimal<T> getter)
Description copied from interface:ToNullableReturns an equivalent expression as this, except that it will return thegetterexpression if given an argument that would cause this expression to returnnull.- Specified by:
orElseGetin interfaceToNullable<T,BigDecimal,ToBigDecimal<T>>- Parameters:
getter- to apply if null- Returns:
- the expression if present, otherwise return
getter
-
orElse
default ToBigDecimal<T> orElse(BigDecimal value)
Description copied from interface:ToNullableReturns an equivalent expression as this, except that it will return thevalueif given an argument that would cause this expression to returnnull.- Specified by:
orElsein interfaceToNullable<T,BigDecimal,ToBigDecimal<T>>- Parameters:
value- value to use if null- Returns:
- the expression if present, otherwise return
value
-
hash
default long hash(T object)
Description copied from interface:HasHashHash the specified object into a 64-bit hash. If two equal objects are hashed, they must always result in the same hash. However, objects that are not equal may also result in the same hash.
-
compare
default int compare(T first, T second)
- Specified by:
comparein interfaceComparator<T>- Specified by:
comparein interfaceHasCompare<T>
-
compose
default <V> ToBigDecimalNullable<V> compose(Function<? super V,? extends T> before)
Description copied from interface:HasComposeReturns a composed expression that first applies thebeforefunction 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.- Specified by:
composein interfaceFunction<T,BigDecimal>- Specified by:
composein interfaceHasCompose<T>- Type Parameters:
V- the type of input to thebeforefunction, and to the composed expression- Parameters:
before- the function to apply before this function is applied- Returns:
- a composed function that first applies the
beforefunction and then applies this function
-
-