@ApiStatus.Internal public class Functions extends Object
Modifier and Type | Field and Description |
---|---|
static Function<Object,Boolean> |
FALSE
Constant
FALSE |
static Function<Object,Boolean> |
TRUE
Constant
TRUE |
Constructor and Description |
---|
Functions() |
Modifier and Type | Method and Description |
---|---|
static <A,B> B |
cast(A a)
Cast argument to it's returning type
|
static <B,C extends B> |
convert(B b)
Cast argument into the captured type
|
static boolean |
isTypeOf(Object v,
Class<?>... arr)
isTypeOf.
|
static <A> A |
returnArg(A a)
returnArg.
|
static <A,B> A |
selectFirst(A a,
B b)
Select first argument of the function and return it
|
static <A,B> B |
selectSecond(A a,
B b)
Select second argument of the function and return it
|
public static <A,B> B cast(A a)
Cast argument to it's returning type
A
- The captured type of the parameterB
- The captured return typea
- a A objectpublic static <B,C extends B> C convert(B b)
Cast argument into the captured type
B
- a B classC
- a C classb
- a B objectpublic static <A> A returnArg(A a)
returnArg.
A
- a A classa
- a A objectpublic static <A,B> A selectFirst(A a, B b)
Select first argument of the function and return it
A
- a A classB
- a B classa
- a A objectb
- a B objectpublic static <A,B> B selectSecond(A a, B b)
Select second argument of the function and return it
A
- a A classB
- a B classa
- a A objectb
- a B objectCopyright © 2016–2024. All rights reserved.