Class ConstructorConstructor

java.lang.Object
com.google.gson.internal.ConstructorConstructor

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

  • Method Details

    • get

      public <T> ObjectConstructor<T> get(TypeToken<T> typeToken)
      Calls get(TypeToken, boolean), and allows usage of JDK Unsafe.
    • 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 String toString()
      Overrides:
      toString in class Object