Class SimpleCollectorFactory

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.stream.Collector<?,​?,​?> collector  
      private java.lang.reflect.Type containerType  
    • Constructor Summary

      Constructors 
      Constructor Description
      SimpleCollectorFactory​(java.lang.reflect.Type containerType, java.util.stream.Collector<?,​?,​?> collector)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean accepts​(java.lang.reflect.Type containerType)
      Accept a Type as a collector.
      java.util.stream.Collector<?,​?,​?> build​(java.lang.reflect.Type containerType)
      Creates a collector for a given container type.
      java.util.Optional<java.lang.reflect.Type> elementType​(java.lang.reflect.Type containerType)
      Returns the element type for a given container type.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

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

      • containerType

        private final java.lang.reflect.Type containerType
      • collector

        private final java.util.stream.Collector<?,​?,​?> collector
    • Constructor Detail

      • SimpleCollectorFactory

        SimpleCollectorFactory​(java.lang.reflect.Type containerType,
                               java.util.stream.Collector<?,​?,​?> collector)
    • Method Detail

      • accepts

        public boolean accepts​(java.lang.reflect.Type containerType)
        Description copied from interface: CollectorFactory
        Accept a Type as a collector.
        Specified by:
        accepts in interface CollectorFactory
        Parameters:
        containerType - the container type.
        Returns:
        whether this factory can produce a collector for the given container type.
      • elementType

        public java.util.Optional<java.lang.reflect.Type> elementType​(java.lang.reflect.Type containerType)
        Description copied from interface: CollectorFactory
        Returns the element type for a given container type.
        Specified by:
        elementType in interface CollectorFactory
        Parameters:
        containerType - the container type.
        Returns:
        the container element type if it can be discovered through reflection; empty otherwise.
        See Also:
        StatementContext.findElementTypeFor(Type)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object