com.aldebaran.qi.serialization
public class SignatureUtilities extends Object
Modifier and Type | Field and Description |
---|---|
static String |
BOOLEAN
Libqi boolean signature
|
static String |
CHARACTER
Libqi char signature
|
static String |
DOUBLE
Libqi double signature
|
static String |
FLOAT
Libqi float signature
|
static String |
INTEGER
Libqi int signature
|
static String |
LONG
Libqi long signature
|
static String |
OBJECT
Libqi Object signature
|
static String |
STRING
Libqi String signature
|
static String |
VOID
Libqi void signature
|
Constructor and Description |
---|
SignatureUtilities() |
Modifier and Type | Method and Description |
---|---|
static List<com.aldebaran.qi.serialization.QiFieldInformation> |
collectSortedQiFieldInformation(Class<?> clazz)
|
static String |
computeSignatureForMethod(Method method)
Compute libqi signature for given method
|
static Object |
convert(Object value,
Class<?> to)
Try to convert a value to a desired type
|
static Type[] |
convertNativeTypeToObjectType(Type... types)
Convert an array of types, if the array contains primitive types they are
convert to their corresponding Object type.
|
static Type |
convertNativeTypeToObjectType(Type type)
Convert a primitive type to its Object type.
|
static Object |
convertValueJavaToLibQI(Object object,
Type desiredType)
Convert a value from Java to value that can be sent to libqi.
|
static boolean |
isBoolean(Class<?> clazz)
Indicates if given class is Boolean or boolean
|
static boolean |
isByte(Class<?> clazz)
Indicates if given class is Byte or byte
|
static boolean |
isCharacter(Class<?> clazz)
Indicates if given class is Character or char
|
static boolean |
isDouble(Class<?> clazz)
Indicates if given class is Double or double
|
static boolean |
isFloat(Class<?> clazz)
Indicates if given class is Float or float
|
static boolean |
isInteger(Class<?> clazz)
Indicates if given class is Integer or int
|
static boolean |
isLong(Class<?> clazz)
Indicates if given class is Long or long
|
static boolean |
isNumber(Class<?> clazz)
Indicates if given class is a Number
|
static boolean |
isShort(Class<?> clazz)
Indicates if given class is Short or short
|
static boolean |
isVoid(Class<?> clazz)
Indicates if given class can be considered as Void or void
|
public static final String BOOLEAN
public static final String CHARACTER
public static final String VOID
public static final String INTEGER
public static final String LONG
public static final String FLOAT
public static final String DOUBLE
public static final String STRING
public static final String OBJECT
public static String computeSignatureForMethod(Method method)
method
- Method to get the signature frompublic static boolean isVoid(Class<?> clazz)
clazz
- Class to testtrue
if given class can be considered as Void or voidpublic static boolean isBoolean(Class<?> clazz)
clazz
- Class to testtrue
if given class is Boolean or booleanpublic static boolean isCharacter(Class<?> clazz)
clazz
- Class to testtrue
if given class is Character or charpublic static boolean isByte(Class<?> clazz)
clazz
- Class to testtrue
if given class is Byte or bytepublic static boolean isShort(Class<?> clazz)
clazz
- Class to testtrue
if given class is Short or shortpublic static boolean isInteger(Class<?> clazz)
clazz
- Class to testtrue
if given class is Integer or intpublic static boolean isLong(Class<?> clazz)
clazz
- Class to testtrue
if given class is Long or longpublic static boolean isFloat(Class<?> clazz)
clazz
- Class to testtrue
if given class is Float or floatpublic static boolean isDouble(Class<?> clazz)
clazz
- Class to testtrue
if given class is Double or doublepublic static boolean isNumber(Class<?> clazz)
clazz
- Class to testtrue
if given class is a Numberpublic static List<com.aldebaran.qi.serialization.QiFieldInformation> collectSortedQiFieldInformation(Class<?> clazz)
QiField(s)
in a
QiStruct
.QiField
order. QiStruct
clazz
- QiStruct
to collect its QiField(s)
QiField(s)
informationpublic static Type convertNativeTypeToObjectType(Type type)
type
- Native type.public static Type[] convertNativeTypeToObjectType(Type... types)
types
- Array to convertpublic static Object convert(Object value, Class<?> to)
value
- Value to convertto
- Destination typeCopyright © 2019. All rights reserved.