Package io.dapr.utils
Class TypeRef<T>
java.lang.Object
io.dapr.utils.TypeRef<T>
- Type Parameters:
T
- Type to be deserialized.
Used to reference a type.
Usage: new TypeRef<MyClass>(){}
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> TypeRef<T>
Creates a reference to a given class type.static <T> TypeRef<T>
Creates a reference to a given class type.getType()
Gets the type referenced.static <T> boolean
isPrimitive
(TypeRef<T> typeRef) Checks if the given TypeRef is of a primitive type Similar to implementation of deserializePrimitives in the classObjectSerializer
It considers only those types as primitives.
-
Field Details
-
STRING
-
BOOLEAN
-
INT
-
LONG
-
SHORT
-
CHAR
-
BYTE
-
VOID
-
FLOAT
-
DOUBLE
-
BYTE_ARRAY
-
INT_ARRAY
-
STRING_ARRAY
-
-
Constructor Details
-
TypeRef
public TypeRef()Constructor.
-
-
Method Details
-
getType
Gets the type referenced.- Returns:
- type referenced.
-
get
Creates a reference to a given class type.- Type Parameters:
T
- Type to be referenced.- Parameters:
clazz
- Class type to be referenced.- Returns:
- Class type reference.
-
get
Creates a reference to a given class type.- Type Parameters:
T
- Type to be referenced.- Parameters:
type
- Type to be referenced.- Returns:
- Class type reference.
-
isPrimitive
Checks if the given TypeRef is of a primitive type Similar to implementation of deserializePrimitives in the classObjectSerializer
It considers only those types as primitives.- Type Parameters:
T
- Type to be referenced.- Parameters:
typeRef
- Type to be referenced.- Returns:
- truth value of whether the given type ref is a primitive reference or not.
-