Enum ReflectionUtils.DataType
- java.lang.Object
-
- java.lang.Enum<ReflectionUtils.DataType>
-
- com.massivecraft.factions.util.Particles.ReflectionUtils.DataType
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<ReflectionUtils.DataType>
,java.lang.constant.Constable
- Enclosing class:
- ReflectionUtils
public static enum ReflectionUtils.DataType extends java.lang.Enum<ReflectionUtils.DataType>
Represents an enumeration of Java data types with corresponding classesThis class is part of the ReflectionUtils and follows the same usage conditions
- Since:
- 1.0
-
-
Method Summary
Modifier and Type Method Description static boolean
compare(java.lang.Class<?>[] primary, java.lang.Class<?>[] secondary)
Compares two class arrays on equivalencestatic ReflectionUtils.DataType
fromClass(java.lang.Class<?> clazz)
Returns the data type with the given primitive/reference classjava.lang.Class<?>
getPrimitive()
Returns the primitive class of this data typestatic java.lang.Class<?>
getPrimitive(java.lang.Class<?> clazz)
Returns the primitive class of the data type with the given reference classstatic java.lang.Class<?>[]
getPrimitive(java.lang.Class<?>[] classes)
Returns the primitive class array of the given class arraystatic java.lang.Class<?>[]
getPrimitive(java.lang.Object[] objects)
Returns the primitive class array of the given object arrayjava.lang.Class<?>
getReference()
Returns the reference class of this data typestatic java.lang.Class<?>
getReference(java.lang.Class<?> clazz)
Returns the reference class of the data type with the given primitive classstatic java.lang.Class<?>[]
getReference(java.lang.Class<?>[] classes)
Returns the reference class array of the given class arraystatic java.lang.Class<?>[]
getReference(java.lang.Object[] objects)
Returns the reference class array of the given object arraystatic ReflectionUtils.DataType
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static ReflectionUtils.DataType[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
BYTE
public static final ReflectionUtils.DataType BYTE
-
SHORT
public static final ReflectionUtils.DataType SHORT
-
INTEGER
public static final ReflectionUtils.DataType INTEGER
-
LONG
public static final ReflectionUtils.DataType LONG
-
CHARACTER
public static final ReflectionUtils.DataType CHARACTER
-
FLOAT
public static final ReflectionUtils.DataType FLOAT
-
DOUBLE
public static final ReflectionUtils.DataType DOUBLE
-
BOOLEAN
public static final ReflectionUtils.DataType BOOLEAN
-
-
Method Detail
-
values
public static ReflectionUtils.DataType[] values()
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static ReflectionUtils.DataType valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
fromClass
public static ReflectionUtils.DataType fromClass(java.lang.Class<?> clazz)
Returns the data type with the given primitive/reference class- Parameters:
clazz
- Primitive/Reference class of the data type- Returns:
- The data type
-
getPrimitive
public static java.lang.Class<?> getPrimitive(java.lang.Class<?> clazz)
Returns the primitive class of the data type with the given reference class- Parameters:
clazz
- Reference class of the data type- Returns:
- The primitive class
-
getReference
public static java.lang.Class<?> getReference(java.lang.Class<?> clazz)
Returns the reference class of the data type with the given primitive class- Parameters:
clazz
- Primitive class of the data type- Returns:
- The reference class
-
getPrimitive
public static java.lang.Class<?>[] getPrimitive(java.lang.Class<?>[] classes)
Returns the primitive class array of the given class array- Parameters:
classes
- Given class array- Returns:
- The primitive class array
-
getReference
public static java.lang.Class<?>[] getReference(java.lang.Class<?>[] classes)
Returns the reference class array of the given class array- Parameters:
classes
- Given class array- Returns:
- The reference class array
-
getPrimitive
public static java.lang.Class<?>[] getPrimitive(java.lang.Object[] objects)
Returns the primitive class array of the given object array- Parameters:
objects
- Given object array- Returns:
- The primitive class array
-
getReference
public static java.lang.Class<?>[] getReference(java.lang.Object[] objects)
Returns the reference class array of the given object array- Parameters:
objects
- Given object array- Returns:
- The reference class array
-
compare
public static boolean compare(java.lang.Class<?>[] primary, java.lang.Class<?>[] secondary)
Compares two class arrays on equivalence- Parameters:
primary
- Primary class arraysecondary
- Class array which is compared to the primary array- Returns:
- Whether these arrays are equal or not
-
getPrimitive
public java.lang.Class<?> getPrimitive()
Returns the primitive class of this data type- Returns:
- The primitive class
-
getReference
public java.lang.Class<?> getReference()
Returns the reference class of this data type- Returns:
- The reference class
-
-