Class ConstructorConstructor


  • public final class ConstructorConstructor
    extends java.lang.Object
    Returns a function that can construct an instance of a requested type.
    • Constructor Detail

      • ConstructorConstructor

        public ConstructorConstructor​(java.util.Map<java.lang.reflect.Type,​InstanceCreator<?>> instanceCreators,
                                      boolean useJdkUnsafe,
                                      java.util.List<ReflectionAccessFilter> reflectionFilters)
    • Method Detail

      • get

        public <T> ObjectConstructor<T> get​(TypeToken<T> typeToken,
                                            boolean allowUnsafe)
        Retrieves an object constructor for the given type.
        Parameters:
        typeToken - type for which a constructor should be retrieved
        allowUnsafe - whether to allow usage of JDK Unsafe; has no effect if useJdkUnsafe is false
      • toString

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