Package com.shanebeestudios.nms.api.util
Class ReflectionUtils
java.lang.Object
com.shanebeestudios.nms.api.util.ReflectionUtils
Utility class with shortcut methods for reflection
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic @Nullable Object
Get the value of a field from an objectstatic void
Set the value of a field in an objectstatic void
Set the value of a field in an object
-
Constructor Details
-
ReflectionUtils
public ReflectionUtils()
-
-
Method Details
-
getField
Get the value of a field from an object- Parameters:
field
- Name of fieldclazz
- Class with fieldobject
- Object which contains field- Returns:
- Object from field
-
setField
Set the value of a field in an object- Parameters:
field
- Name of field to setclazz
- Class with fieldobject
- Object which holds fieldtoSet
- Object to set
-
setField
Set the value of a field in an object- Parameters:
field
- Name of field to setobject
- Object which holds fieldtoSet
- Object to set
-