Class Collect
java.lang.Object
com.headius.invokebinder.transform.Transform
com.headius.invokebinder.transform.Collect
A filter that takes multiple arguments and replaces them with zero or one argument of a new type.
Equivalent call: MethodHandle.asCollector(Class, int) or MethodHandles.collectArguments
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final MethodHandleprivate final intprivate final intprivate final Class<?> private final MethodType -
Constructor Summary
ConstructorsConstructorDescriptionCollect(MethodType source, int index, int count, Class<?> resultType) Collect(MethodType source, int index, int count, Class<?> resultType, MethodHandle collector) Collect(MethodType source, int index, Class<?> resultType) Collect(MethodType source, int index, Class<?> resultType, MethodHandle collector) -
Method Summary
Modifier and TypeMethodDescriptionprivate voidprivate Collect.PermutesbuildPermutes(MethodType source, MethodType target) down(MethodType type) Apply this transform downward from an incoming MethodType, producing a new type.private booleanonlyTail()private BinderpreparePermuteBinder(Collect.Permutes permutes) toJava(MethodType incoming) Return a Java code representation of this transform.toString()Return a string representation of this transform.up(MethodHandle target) Apply this transform upward from the given MethodHandle, producing a new handle.Methods inherited from class com.headius.invokebinder.transform.Transform
buildClassArgument, buildClassArguments, buildClassCast, buildPrimitiveJava, generateMethodType
-
Field Details
-
source
-
index
private final int index -
count
private final int count -
resultType
-
collector
-
-
Constructor Details
-
Collect
-
Collect
-
Collect
-
Collect
public Collect(MethodType source, int index, int count, Class<?> resultType, MethodHandle collector)
-
-
Method Details
-
up
Description copied from class:TransformApply this transform upward from the given MethodHandle, producing a new handle. -
preparePermuteBinder
-
down
Description copied from class:TransformApply this transform downward from an incoming MethodType, producing a new type. -
assertTypesAreCompatible
private void assertTypesAreCompatible() -
toString
Description copied from class:TransformReturn a string representation of this transform. -
toJava
Description copied from class:TransformReturn a Java code representation of this transform. -
onlyTail
private boolean onlyTail() -
buildPermutes
-