Class Instantiator<T>
- java.lang.Object
-
- nl.jqno.equalsverifier.internal.reflection.Instantiator<T>
-
- Type Parameters:
T
-Instantiator
instantiates objects of this class, or of an anonymous subclass of this class.
public final class Instantiator<T> extends Object
Instantiates objects of a given class.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <S> net.bytebuddy.dynamic.loading.ClassLoadingStrategy<? super ClassLoader>
getClassLoadingStrategy(Class<S> context)
T
instantiate()
Instantiates an object of type T.T
instantiateAnonymousSubclass()
Instantiates an anonymous subclass of T.static <T> Instantiator<T>
of(Class<T> type)
Factory method.
-
-
-
Method Detail
-
of
public static <T> Instantiator<T> of(Class<T> type)
Factory method.- Type Parameters:
T
- The class on whichInstantiator
operates.- Parameters:
type
- The class on whichInstantiator
operates. Should be the same as T.- Returns:
- An
Instantiator
fortype
.
-
instantiate
public T instantiate()
Instantiates an object of type T.All fields will be initialized to their initial values. I.e., 0 for ints, null for objects, etc.
- Returns:
- An object of type T.
-
instantiateAnonymousSubclass
public T instantiateAnonymousSubclass()
Instantiates an anonymous subclass of T. The subclass is generated dynamically.- Returns:
- An instance of an anonymous subclass of T.
-
getClassLoadingStrategy
public static <S> net.bytebuddy.dynamic.loading.ClassLoadingStrategy<? super ClassLoader> getClassLoadingStrategy(Class<S> context)
-
-