Interface ToNullable<T,R,NON_NULLABLE extends Expression<T>>
-
- Type Parameters:
T- type to extract fromR- return typeNON_NULLABLE- the expression type obtained if the nullability of this expression is handled
- All Superinterfaces:
Expression<T>,Function<T,R>
- All Known Subinterfaces:
ToBigDecimalNullable<T>,ToBooleanNullable<T>,ToByteNullable<T>,ToCharNullable<T>,ToDoubleNullable<T>,ToEnumNullable<T,E>,ToFloatNullable<T>,ToIntNullable<T>,ToLongNullable<T>,ToShortNullable<T>,ToStringNullable<T>
public interface ToNullable<T,R,NON_NULLABLE extends Expression<T>> extends Function<T,R>, Expression<T>
Trait for expressions that result in a nullable value. Those expressions have additional methods for checking fornull-values.- Since:
- 3.1.0
- Author:
- Emil Forslund
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default IsNotNull<T,R>isNotNull()Returns aPredicatethat isfalsefor any values that would make this expression returnnullandtruefor any values that would make this expression return a result.default booleanisNotNull(T object)Returnsfalseif the specified object would cause this methodsFunction.apply(Object)-method to returnnull, and otherwisetrue.default IsNull<T,R>isNull()Returns aPredicatethat istruefor any values that would make this expression returnnullandfalsefor any values that would make this expression return a result.default booleanisNull(T object)Returnstrueif the specified object would cause this methodsFunction.apply(Object)-method to returnnull, and otherwisefalse.NON_NULLABLEorElse(R value)Returns an equivalent expression as this, except that it will return thevalueif given an argument that would cause this expression to returnnull.NON_NULLABLEorElseGet(NON_NULLABLE getter)Returns an equivalent expression as this, except that it will return thegetterexpression if given an argument that would cause this expression to returnnull.NON_NULLABLEorThrow()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 com.speedment.runtime.compute.expression.Expression
expressionType
-
-
-
-
Method Detail
-
isNull
default IsNull<T,R> isNull()
Returns aPredicatethat istruefor any values that would make this expression returnnullandfalsefor any values that would make this expression return a result.- Returns:
- a predicate that tests if this expression would return
null
-
isNotNull
default IsNotNull<T,R> isNotNull()
Returns aPredicatethat isfalsefor any values that would make this expression returnnullandtruefor any values that would make this expression return a result.- Returns:
- a predicate that tests if this expression would return something
other than
null
-
isNull
default boolean isNull(T object)
Returnstrueif the specified object would cause this methodsFunction.apply(Object)-method to returnnull, and otherwisefalse.- Parameters:
object- the incoming entity to test on- Returns:
trueif the expression would returnnull, elsefalse
-
isNotNull
default boolean isNotNull(T object)
Returnsfalseif the specified object would cause this methodsFunction.apply(Object)-method to returnnull, and otherwisetrue.- Parameters:
object- the incoming entity to test on- Returns:
falseif the expression would returnnull, elsetrue
-
orThrow
NON_NULLABLE orThrow()
Returns an equivalent expression as this, except that it will throw aNullPointerExceptionif given an argument that would cause this expression to returnnull.- Returns:
- the expression if present
-
orElseGet
NON_NULLABLE orElseGet(NON_NULLABLE getter)
Returns an equivalent expression as this, except that it will return thegetterexpression if given an argument that would cause this expression to returnnull.- Parameters:
getter- to apply if null- Returns:
- the expression if present, otherwise return
getter
-
orElse
NON_NULLABLE orElse(R value)
Returns an equivalent expression as this, except that it will return thevalueif given an argument that would cause this expression to returnnull.- Parameters:
value- value to use if null- Returns:
- the expression if present, otherwise return
value
-
-