public class TestTools extends java.lang.Object
Constructor and Description |
---|
TestTools() |
Modifier and Type | Method and Description |
---|---|
static java.lang.reflect.Field |
getPrivateField(java.lang.Class<? extends java.lang.Object> objectClass,
java.lang.String name) |
static java.lang.Object |
getPrivateFieldValue(java.lang.Object object,
java.lang.String name) |
static java.lang.reflect.Method |
getPrivateMethod(java.lang.Class<? extends java.lang.Object> objectClass,
java.lang.String name,
java.lang.Class... params)
Returns an accessible private method.
|
static java.lang.StringBuffer |
toBinaryRepresentation(byte value)
Returns a string buffer containing the two's complement representation (consisting of 8 bits) of
a
byte value |
static java.lang.StringBuffer |
toBinaryRepresentation(int value)
Returns a string buffer containing the two's complement representation (consisting of 32 bits) of
an
int value |
static java.lang.StringBuffer |
toBinaryRepresentation(long value)
Returns a string buffer containing the two's complement representation (consisting of 64 bits) of
a
long value |
static java.lang.StringBuffer |
toBinaryRepresentation(short value)
Returns a string buffer containing the two's complement representation (consisting of 16 bits) of
a
short value |
public TestTools()
public static java.lang.reflect.Method getPrivateMethod(java.lang.Class<? extends java.lang.Object> objectClass, java.lang.String name, java.lang.Class... params)
objectClass
- name
- params
- public static java.lang.reflect.Field getPrivateField(java.lang.Class<? extends java.lang.Object> objectClass, java.lang.String name)
public static java.lang.Object getPrivateFieldValue(java.lang.Object object, java.lang.String name)
public static java.lang.StringBuffer toBinaryRepresentation(byte value)
byte
valuevalue
- the value to be displayedpublic static java.lang.StringBuffer toBinaryRepresentation(short value)
short
valuevalue
- the value to be displayedpublic static java.lang.StringBuffer toBinaryRepresentation(int value)
int
valuevalue
- the value to be displayedpublic static java.lang.StringBuffer toBinaryRepresentation(long value)
long
valuevalue
- the value to be displayed