Class ReflectionObject
java.lang.Object
com.github.retrooper.packetevents.util.reflection.ReflectionObject
- All Implemented Interfaces:
ReflectionObjectReader
,ReflectionObjectWriter
public class ReflectionObject
extends Object
implements ReflectionObjectReader, ReflectionObjectWriter
-
Field Summary
-
Constructor Summary
ConstructorDescriptionReflectionObject
(Object object) ReflectionObject
(Object object, Class<?> clazz) -
Method Summary
Modifier and TypeMethodDescription<T> T
readAnyObject
(int index) boolean
readBoolean
(int index) boolean[]
readBooleanArray
(int index) byte
readByte
(int index) byte[]
readByteArray
(int index) double
readDouble
(int index) double[]
readDoubleArray
(int index) Enum
<?> readEnumConstant
(int index, Class<? extends Enum<?>> type) float
readFloat
(int index) float[]
readFloatArray
(int index) int
readInt
(int index) int[]
readIntArray
(int index) <T> List
<T> readList
(int index) long
readLong
(int index) long[]
readLongArray
(int index) <T> T
readObject
(int index, Class<? extends T> type) <T> T[]
readObjectArray
(int index, Class<? extends T> type) short
readShort
(int index) short[]
readShortArray
(int index) readString
(int index) String[]
readStringArray
(int index) void
void
writeAnyObject
(int index, Object value) void
writeBoolean
(int index, boolean value) void
writeBooleanArray
(int index, boolean[] array) void
writeByte
(int index, byte value) void
writeByteArray
(int index, byte[] value) void
writeDouble
(int index, double value) void
writeDoubleArray
(int index, double[] value) void
writeEnumConstant
(int index, Enum<?> enumConstant) void
writeFloat
(int index, float value) void
writeFloatArray
(int index, float[] value) void
writeInt
(int index, int value) void
writeIntArray
(int index, int[] value) void
void
writeLong
(int index, long value) void
writeLongArray
(int index, long[] value) void
writeObject
(int index, Object value) void
writeShort
(int index, short value) void
writeShortArray
(int index, short[] value) void
writeString
(int index, String value) void
writeStringArray
(int index, String[] value)
-
Field Details
-
object
-
-
Constructor Details
-
ReflectionObject
public ReflectionObject() -
ReflectionObject
-
ReflectionObject
-
-
Method Details
-
readBoolean
public boolean readBoolean(int index) - Specified by:
readBoolean
in interfaceReflectionObjectReader
-
readByte
public byte readByte(int index) - Specified by:
readByte
in interfaceReflectionObjectReader
-
readShort
public short readShort(int index) - Specified by:
readShort
in interfaceReflectionObjectReader
-
readInt
public int readInt(int index) - Specified by:
readInt
in interfaceReflectionObjectReader
-
readLong
public long readLong(int index) - Specified by:
readLong
in interfaceReflectionObjectReader
-
readFloat
public float readFloat(int index) - Specified by:
readFloat
in interfaceReflectionObjectReader
-
readDouble
public double readDouble(int index) - Specified by:
readDouble
in interfaceReflectionObjectReader
-
readBooleanArray
public boolean[] readBooleanArray(int index) - Specified by:
readBooleanArray
in interfaceReflectionObjectReader
-
readByteArray
public byte[] readByteArray(int index) - Specified by:
readByteArray
in interfaceReflectionObjectReader
-
readShortArray
public short[] readShortArray(int index) - Specified by:
readShortArray
in interfaceReflectionObjectReader
-
readIntArray
public int[] readIntArray(int index) - Specified by:
readIntArray
in interfaceReflectionObjectReader
-
readLongArray
public long[] readLongArray(int index) - Specified by:
readLongArray
in interfaceReflectionObjectReader
-
readFloatArray
public float[] readFloatArray(int index) - Specified by:
readFloatArray
in interfaceReflectionObjectReader
-
readDoubleArray
public double[] readDoubleArray(int index) - Specified by:
readDoubleArray
in interfaceReflectionObjectReader
-
readStringArray
- Specified by:
readStringArray
in interfaceReflectionObjectReader
-
readString
- Specified by:
readString
in interfaceReflectionObjectReader
-
readAnyObject
- Specified by:
readAnyObject
in interfaceReflectionObjectReader
-
readObject
- Specified by:
readObject
in interfaceReflectionObjectReader
-
readObjectArray
- Specified by:
readObjectArray
in interfaceReflectionObjectReader
-
readEnumConstant
- Specified by:
readEnumConstant
in interfaceReflectionObjectReader
-
read
-
writeBoolean
public void writeBoolean(int index, boolean value) - Specified by:
writeBoolean
in interfaceReflectionObjectWriter
-
writeByte
public void writeByte(int index, byte value) - Specified by:
writeByte
in interfaceReflectionObjectWriter
-
writeShort
public void writeShort(int index, short value) - Specified by:
writeShort
in interfaceReflectionObjectWriter
-
writeInt
public void writeInt(int index, int value) - Specified by:
writeInt
in interfaceReflectionObjectWriter
-
writeLong
public void writeLong(int index, long value) - Specified by:
writeLong
in interfaceReflectionObjectWriter
-
writeFloat
public void writeFloat(int index, float value) - Specified by:
writeFloat
in interfaceReflectionObjectWriter
-
writeDouble
public void writeDouble(int index, double value) - Specified by:
writeDouble
in interfaceReflectionObjectWriter
-
writeString
- Specified by:
writeString
in interfaceReflectionObjectWriter
-
writeObject
- Specified by:
writeObject
in interfaceReflectionObjectWriter
-
writeBooleanArray
public void writeBooleanArray(int index, boolean[] array) - Specified by:
writeBooleanArray
in interfaceReflectionObjectWriter
-
writeByteArray
public void writeByteArray(int index, byte[] value) - Specified by:
writeByteArray
in interfaceReflectionObjectWriter
-
writeShortArray
public void writeShortArray(int index, short[] value) - Specified by:
writeShortArray
in interfaceReflectionObjectWriter
-
writeIntArray
public void writeIntArray(int index, int[] value) - Specified by:
writeIntArray
in interfaceReflectionObjectWriter
-
writeLongArray
public void writeLongArray(int index, long[] value) - Specified by:
writeLongArray
in interfaceReflectionObjectWriter
-
writeFloatArray
public void writeFloatArray(int index, float[] value) - Specified by:
writeFloatArray
in interfaceReflectionObjectWriter
-
writeDoubleArray
public void writeDoubleArray(int index, double[] value) - Specified by:
writeDoubleArray
in interfaceReflectionObjectWriter
-
writeStringArray
- Specified by:
writeStringArray
in interfaceReflectionObjectWriter
-
writeAnyObject
- Specified by:
writeAnyObject
in interfaceReflectionObjectWriter
-
writeEnumConstant
- Specified by:
writeEnumConstant
in interfaceReflectionObjectWriter
-
write
- Throws:
IllegalStateException
-
readList
-
writeList
-