Class VavrCollectorFactory

java.lang.Object
org.jdbi.v3.vavr.VavrCollectorFactory
All Implemented Interfaces:
CollectorFactory

class VavrCollectorFactory extends Object implements CollectorFactory
  • Field Details

    • defaultImplementations

      private final io.vavr.collection.Map<Class<?>,Class<?>> defaultImplementations
    • collectors

      private final io.vavr.collection.Map<Class<?>,Collector<?,?,?>> collectors
  • Constructor Details

    • VavrCollectorFactory

      VavrCollectorFactory()
  • Method Details

    • accepts

      public boolean accepts(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.
    • getCollectionType

      private Class<?> getCollectionType(Type containerType)
    • hasDefaultImplementationWithCollector

      private boolean hasDefaultImplementationWithCollector(Class<?> erasedType)
    • resolveDefaultCollector

      private io.vavr.control.Option<Collector<?,?,?>> resolveDefaultCollector(Class<?> erasedType)
    • elementType

      public Optional<Type> elementType(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:
    • build

      public Collector<?,?,?> build(Type containerType)
      Description copied from interface: CollectorFactory
      Creates a collector for a given container type.
      Specified by:
      build in interface CollectorFactory
      Parameters:
      containerType - the container type.
      Returns:
      a Collector for the given container type.
      See Also:
    • resolveMaplikeEntryType

      private static Type resolveMaplikeEntryType(Type maplikeType, Class<?> maplikeClass)