- java.lang.Object
-
- com.uddernetworks.newocr.configuration.ConfigReflectionCacher
-
- All Implemented Interfaces:
ReflectionCacher
public class ConfigReflectionCacher extends java.lang.Object implements ReflectionCacher
A class to cache constructors from theHOCONFontConfiguration
.- Since:
- April 25, 2019
-
-
Constructor Summary
Constructors Constructor Description 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.
-
-
-
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 interfaceReflectionCacher
- Type Parameters:
T
- The class type- Parameters:
clazz
- The class to generate or fetch the constructor fromconstructorGenerator
- The supplier to make the constructor if one is not found- Returns:
- The constructor, if found
-
-