public class ReflectionUtility
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static @Nullable java.lang.Object |
createArray(@Nullable java.lang.Class<?> clazz,
@Range(from=0L,to=2147483647L) int length)
Returns a new array of the specified class with the specified length
|
static @Nullable java.lang.Class<?> |
getClass(int major,
int minor,
int patch,
@NotNull java.lang.Class<?> reflectionClass)
Returns a
Class from a reflection class if AnnoyingPlugin.MINECRAFT_VERSION is greater than or equal to the minimum version |
static @Nullable java.lang.Class<?> |
getClass(int major,
int minor,
int patch,
@NotNull java.lang.String className)
Returns a
Class if AnnoyingPlugin.MINECRAFT_VERSION is greater than or equal to the minimum version |
static @Nullable java.lang.Class<?> |
getClassArray(int major,
int minor,
int patch,
@NotNull java.lang.Class<?> reflectionClass)
Returns an array
Class from a reflection class if AnnoyingPlugin.MINECRAFT_VERSION is greater than or equal to the minimum version |
static @Nullable java.lang.Class<?> |
getClassArray(int major,
int minor,
int patch,
@NotNull java.lang.String className)
Returns an array
Class if AnnoyingPlugin.MINECRAFT_VERSION is greater than or equal to the minimum version |
static <T> @Nullable java.lang.reflect.Constructor<T> |
getConstructor(int major,
int minor,
int patch,
@Nullable java.lang.Class<T> clazz,
java.lang.Class<?>... parameterTypes)
Returns a
Constructor if AnnoyingPlugin.MINECRAFT_VERSION is greater than or equal to the minimum version, the class is not null, and none of the parameter types are null |
static @Nullable java.lang.Class<? extends java.lang.Enum> |
getEnum(int major,
int minor,
int patch,
@NotNull java.lang.Class<?> reflectionClass)
Returns an
Enum Class from a reflection class if AnnoyingPlugin.MINECRAFT_VERSION is greater than or equal to the minimum version |
static @Nullable java.lang.Class<? extends java.lang.Enum> |
getEnum(int major,
int minor,
int patch,
@NotNull java.lang.String enumClassName)
Returns an
Enum Class if AnnoyingPlugin.MINECRAFT_VERSION is greater than or equal to the minimum version |
static <T extends java.lang.Enum> |
getEnumValue(int major,
int minor,
int patch,
@Nullable java.lang.Class<T> enumClass,
@NotNull java.lang.String enumName)
Returns an
Enum value if AnnoyingPlugin.MINECRAFT_VERSION is greater than or equal to the minimum version |
static @Nullable java.lang.reflect.Field |
getField(int major,
int minor,
int patch,
@Nullable java.lang.Class<?> clazz,
@NotNull java.lang.String fieldName)
Returns a
Field if AnnoyingPlugin.MINECRAFT_VERSION is greater than or equal to the minimum version |
static <T> @Nullable java.lang.reflect.Method |
getMethod(int major,
int minor,
int patch,
@Nullable java.lang.Class<T> clazz,
@NotNull java.lang.String methodName,
java.lang.Class<?>... parameterTypes)
Returns a
Method if AnnoyingPlugin.MINECRAFT_VERSION is greater than or equal to the minimum version, the class is not null, and none of the parameter types are null |
static @Nullable java.lang.Object |
getStaticFieldValue(int major,
int minor,
int patch,
@Nullable java.lang.Class<?> clazz,
@NotNull java.lang.String fieldName)
Returns the value of a static
Field if the result of getField(int, int, int, Class, String) is not null |
@Nullable
public static @Nullable java.lang.Class<?> getClass(int major,
int minor,
int patch,
@NotNull
@NotNull java.lang.String className)
Class if AnnoyingPlugin.MINECRAFT_VERSION is greater than or equal to the minimum versionmajor - the major version of the minimum versionminor - the minor version of the minimum versionpatch - the patch version of the minimum versionclassName - the class name@Nullable
public static @Nullable java.lang.Class<?> getClass(int major,
int minor,
int patch,
@NotNull
@NotNull java.lang.Class<?> reflectionClass)
Class from a reflection class if AnnoyingPlugin.MINECRAFT_VERSION is greater than or equal to the minimum versionmajor - the major version of the minimum versionminor - the minor version of the minimum versionpatch - the patch version of the minimum versionreflectionClass - the reflection class@Nullable
public static @Nullable java.lang.Class<? extends java.lang.Enum> getEnum(int major,
int minor,
int patch,
@NotNull
@NotNull java.lang.String enumClassName)
Enum Class if AnnoyingPlugin.MINECRAFT_VERSION is greater than or equal to the minimum versionmajor - the major version of the minimum versionminor - the minor version of the minimum versionpatch - the patch version of the minimum versionenumClassName - the enum class name@Nullable
public static @Nullable java.lang.Class<? extends java.lang.Enum> getEnum(int major,
int minor,
int patch,
@NotNull
@NotNull java.lang.Class<?> reflectionClass)
Enum Class from a reflection class if AnnoyingPlugin.MINECRAFT_VERSION is greater than or equal to the minimum versionmajor - the major version of the minimum versionminor - the minor version of the minimum versionpatch - the patch version of the minimum versionreflectionClass - the reflection class@Nullable
public static @Nullable java.lang.Class<?> getClassArray(int major,
int minor,
int patch,
@NotNull
@NotNull java.lang.String className)
Class if AnnoyingPlugin.MINECRAFT_VERSION is greater than or equal to the minimum versionmajor - the major version of the minimum versionminor - the minor version of the minimum versionpatch - the patch version of the minimum versionclassName - the class name@Nullable
public static @Nullable java.lang.Class<?> getClassArray(int major,
int minor,
int patch,
@NotNull
@NotNull java.lang.Class<?> reflectionClass)
Class from a reflection class if AnnoyingPlugin.MINECRAFT_VERSION is greater than or equal to the minimum versionmajor - the major version of the minimum versionminor - the minor version of the minimum versionpatch - the patch version of the minimum versionreflectionClass - the reflection class@Nullable
public static <T> @Nullable java.lang.reflect.Constructor<T> getConstructor(int major,
int minor,
int patch,
@Nullable
@Nullable java.lang.Class<T> clazz,
@Nullable
java.lang.Class<?>... parameterTypes)
Constructor if AnnoyingPlugin.MINECRAFT_VERSION is greater than or equal to the minimum version, the class is not null, and none of the parameter types are nullT - the type of the classmajor - the major version of the minimum versionminor - the minor version of the minimum versionpatch - the patch version of the minimum versionclazz - the class to get the constructor fromparameterTypes - the parameter types of the constructor@Nullable
public static <T> @Nullable java.lang.reflect.Method getMethod(int major,
int minor,
int patch,
@Nullable
@Nullable java.lang.Class<T> clazz,
@NotNull
@NotNull java.lang.String methodName,
@Nullable
java.lang.Class<?>... parameterTypes)
Method if AnnoyingPlugin.MINECRAFT_VERSION is greater than or equal to the minimum version, the class is not null, and none of the parameter types are nullT - the type of the classmajor - the major version of the minimum versionminor - the minor version of the minimum versionpatch - the patch version of the minimum versionclazz - the class to get the method frommethodName - the name of the methodparameterTypes - the parameter types of the method@Nullable
public static @Nullable java.lang.reflect.Field getField(int major,
int minor,
int patch,
@Nullable
@Nullable java.lang.Class<?> clazz,
@NotNull
@NotNull java.lang.String fieldName)
Field if AnnoyingPlugin.MINECRAFT_VERSION is greater than or equal to the minimum versionmajor - the major version of the minimum versionminor - the minor version of the minimum versionpatch - the patch version of the minimum versionclazz - the class to get the field fromfieldName - the name of the field@Nullable
public static @Nullable java.lang.Object getStaticFieldValue(int major,
int minor,
int patch,
@Nullable
@Nullable java.lang.Class<?> clazz,
@NotNull
@NotNull java.lang.String fieldName)
Field if the result of getField(int, int, int, Class, String) is not nullmajor - the major version of the minimum versionminor - the minor version of the minimum versionpatch - the patch version of the minimum versionclazz - the class to get the field fromfieldName - the name of the fieldgetField(int, int, int, Class, String) is not null, otherwise null@Nullable
public static <T extends java.lang.Enum> T getEnumValue(int major,
int minor,
int patch,
@Nullable
@Nullable java.lang.Class<T> enumClass,
@NotNull
@NotNull java.lang.String enumName)
Enum value if AnnoyingPlugin.MINECRAFT_VERSION is greater than or equal to the minimum versionT - the type of the enummajor - the major version of the minimum versionminor - the minor version of the minimum versionpatch - the patch version of the minimum versionenumClass - the enum classenumName - the name of the enum@Nullable
@Contract(value="null, _ -> null")
public static @Nullable java.lang.Object createArray(@Nullable
@Nullable java.lang.Class<?> clazz,
@Range(from=0L,to=2147483647L) int length)
clazz - the class of the arraylength - the length of the array