Class Collect


  • public class Collect
    extends Transform
    An argument-boxing transform with a fixed incoming size. Equivalent call: MethodHandle.asCollector(Class, int)
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.Class arrayType  
      private int index  
      private java.lang.invoke.MethodType source  
    • Constructor Summary

      Constructors 
      Constructor Description
      Collect​(java.lang.invoke.MethodType source, int index, java.lang.Class arrayType)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private void assertTypesAreCompatible()  
      java.lang.invoke.MethodType down​(java.lang.invoke.MethodType type)
      Apply this transform downward from an incoming MethodType, producing a new type.
      java.lang.String toString()
      Return a string representation of this transform.
      java.lang.invoke.MethodHandle up​(java.lang.invoke.MethodHandle target)
      Apply this transform upward from the given MethodHandle, producing a new handle.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • source

        private final java.lang.invoke.MethodType source
      • index

        private int index
      • arrayType

        private final java.lang.Class arrayType
    • Constructor Detail

      • Collect

        public Collect​(java.lang.invoke.MethodType source,
                       int index,
                       java.lang.Class arrayType)
    • Method Detail

      • up

        public java.lang.invoke.MethodHandle up​(java.lang.invoke.MethodHandle target)
        Description copied from class: Transform
        Apply this transform upward from the given MethodHandle, producing a new handle.
        Specified by:
        up in class Transform
        Parameters:
        target - the target handle
        Returns:
        the adapted handle
      • down

        public java.lang.invoke.MethodType down​(java.lang.invoke.MethodType type)
        Description copied from class: Transform
        Apply this transform downward from an incoming MethodType, producing a new type.
        Specified by:
        down in class Transform
        Parameters:
        type - the source type
        Returns:
        the new type
      • assertTypesAreCompatible

        private void assertTypesAreCompatible()
      • toString

        public java.lang.String toString()
        Description copied from class: Transform
        Return a string representation of this transform.
        Specified by:
        toString in class Transform