-
- Type Parameters:
T- type to extract from
- All Superinterfaces:
Comparator<T>,Expression<T>,HasAsDouble<T>,HasAsInt<T>,HasAsLong<T>,HasCase<T,ToChar<T>>,HasCompare<T>,HasCompose<T>,HasHash<T>,HasMap<T,CharUnaryOperator,ToChar<T>>,ToCharFunction<T>
- All Known Subinterfaces:
ToCharOrElse<T>,ToCharOrElseGet<T>,ToCharOrThrow<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 ToChar<T> extends Expression<T>, ToCharFunction<T>, HasAsDouble<T>, HasAsInt<T>, HasAsLong<T>, HasMap<T,CharUnaryOperator,ToChar<T>>, HasCase<T,ToChar<T>>, HasHash<T>, HasCompare<T>, HasCompose<T>
Expression that given an entity returns acharvalue. 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:
- Emil Forslund
- See Also:
ToCharFunction
-
-
Method Summary
All Methods Static Methods Instance Methods Default Methods Modifier and Type Method Description default ToDouble<T>asDouble()Returns an expression that casts the result of the current expression into adouble.default ToInt<T>asInt()Returns an expression that casts the result of the current expression into anint.default ToLong<T>asLong()Returns an expression that casts the result of the current expression into along.default intcompare(T first, T second)default <V> ToCharNullable<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.default ToChar<T>map(CharUnaryOperator operator)Returns an expression for the value of this expression mapped using the specified mapping function.static <T> ToChar<T>of(ToCharFunction<T> lambda)Returns a typedToChar<T>using the providedlambda.default ToChar<T>toLowerCase()Returns an expression that is equivalent to this expression, except that results are always in lower-case letters.default ToChar<T>toUpperCase()Returns an expression that is equivalent to this expression, except that results are always in upper-case letters.-
Methods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Methods inherited from interface com.speedment.common.function.ToCharFunction
applyAsChar
-
-
-
-
Method Detail
-
of
static <T> ToChar<T> of(ToCharFunction<T> lambda)
Returns a typedToChar<T>using the providedlambda.- Type Parameters:
T- type to extract from- Parameters:
lambda- to convert- Returns:
- a typed
ToChar<T>using the providedlambda - Throws:
NullPointerException- if the providedlambdaisnull
-
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
-
asDouble
default ToDouble<T> asDouble()
Description copied from interface:HasAsDoubleReturns an expression that casts the result of the current expression into adouble.- Specified by:
asDoublein interfaceHasAsDouble<T>- Returns:
- the casted expression
-
asInt
default ToInt<T> asInt()
Description copied from interface:HasAsIntReturns an expression that casts the result of the current expression into anint.
-
asLong
default ToLong<T> asLong()
Description copied from interface:HasAsLongReturns an expression that casts the result of the current expression into along.
-
map
default ToChar<T> map(CharUnaryOperator operator)
Description copied from interface:HasMapReturns an expression for the value of this expression mapped using the specified mapping function. The input type remains the same.
-
toUpperCase
default ToChar<T> toUpperCase()
Description copied from interface:HasCaseReturns an expression that is equivalent to this expression, except that results are always in upper-case letters.- Specified by:
toUpperCasein interfaceHasCase<T,ToChar<T>>- Returns:
- the upper case expression
-
toLowerCase
default ToChar<T> toLowerCase()
Description copied from interface:HasCaseReturns an expression that is equivalent to this expression, except that results are always in lower-case letters.- Specified by:
toLowerCasein interfaceHasCase<T,ToChar<T>>- Returns:
- the lower case expression
-
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> ToCharNullable<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 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
-
-