Class InstantiationUtil
java.lang.Object
com.blamejared.crafttweaker.api.util.InstantiationUtil
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> TgetOrCreateInstance(Class<T> cls) Tries to get the instance two ways (in this order): 1) Via a public static field (recommended being final as well) 2) Via a public no-arg constructor
-
Constructor Details
-
InstantiationUtil
public InstantiationUtil()
-
-
Method Details
-
getOrCreateInstance
Tries to get the instance two ways (in this order): 1) Via a public static field (recommended being final as well) 2) Via a public no-arg constructorDoes absolutely no caching, so don't call this when not necessary
- Parameters:
cls- The class to instantiate- Returns:
- The instance, or 'null'
-