Module NewOCR

Class ConfigReflectionCacher

    • Method Summary

      Modifier and Type Method Description
      <T> java.util.Optional<java.lang.reflect.Constructor<T>> getOrLookupConstructor​(java.lang.Class<T> clazz, ReflexiveSupplier<java.lang.reflect.Constructor<T>> constructorGenerator)
      Gets a constructor from the internal cache from the given class, or generate one via constructorGenerator.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ConfigReflectionCacher

        public ConfigReflectionCacher()
    • Method Detail

      • getOrLookupConstructor

        public <T> java.util.Optional<java.lang.reflect.Constructor<T>> getOrLookupConstructor​(java.lang.Class<T> clazz,
                                                                                               ReflexiveSupplier<java.lang.reflect.Constructor<T>> constructorGenerator)
        Description copied from interface: ReflectionCacher
        Gets a constructor from the internal cache from the given class, or generate one via constructorGenerator. The generation of one from constructorGenerator then saves it in the local cache.
        Specified by:
        getOrLookupConstructor in interface ReflectionCacher
        Type Parameters:
        T - The class type
        Parameters:
        clazz - The class to generate or fetch the constructor from
        constructorGenerator - The supplier to make the constructor if one is not found
        Returns:
        The constructor, if found