Package io.dapr.utils

# Class TypeRef<T>

java.lang.Object
io.dapr.utils.TypeRef<T>

Type Parameters:
  `T` - Type to be deserialized.

    public abstract class TypeRef<T>
    extends java.lang.Object

Used to reference a type.

Usage: new TypeRef<MyClass>(){}

- ## Field Summary

  Fields
  Modifier and Type | Field | Description
  --- | --- | ---
  `static TypeRef<java.lang.Boolean>` | `BOOLEAN` |
  `static TypeRef<java.lang.Byte>` | `BYTE` |
  `static TypeRef<byte[]>` | `BYTE_ARRAY` |
  `static TypeRef<java.lang.Character>` | `CHAR` |
  `static TypeRef<java.lang.Double>` | `DOUBLE` |
  `static TypeRef<java.lang.Float>` | `FLOAT` |
  `static TypeRef<java.lang.Integer>` | `INT` |
  `static TypeRef<int[]>` | `INT_ARRAY` |
  `static TypeRef<java.lang.Long>` | `LONG` |
  `static TypeRef<java.lang.String>` | `STRING` |
  `static TypeRef<java.lang.String[]>` | `STRING_ARRAY` |
  `static TypeRef<java.lang.Void>` | `VOID` |

- ## Constructor Summary

  Constructors
  Constructor | Description
  --- | ---
  `TypeRef()` | Constructor.

- ## Method Summary

  Modifier and Type | Method | Description
  --- | --- | ---
  `static <T> TypeRef<T>` | `get​(java.lang.Class<T> clazz)` | Creates a reference to a given class type.
  `java.lang.reflect.Type` | `getType()` | Gets the type referenced.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### STRING

    public static final TypeRef<java.lang.String> STRING

  - ### BOOLEAN

    public static final TypeRef<java.lang.Boolean> BOOLEAN

  - ### INT

    public static final TypeRef<java.lang.Integer> INT

  - ### LONG

    public static final TypeRef<java.lang.Long> LONG

  - ### CHAR

    public static final TypeRef<java.lang.Character> CHAR

  - ### BYTE

    public static final TypeRef<java.lang.Byte> BYTE

  - ### VOID

    public static final TypeRef<java.lang.Void> VOID

  - ### FLOAT

    public static final TypeRef<java.lang.Float> FLOAT

  - ### DOUBLE

    public static final TypeRef<java.lang.Double> DOUBLE

  - ### BYTE_ARRAY

    public static final TypeRef<byte[]> BYTE_ARRAY

  - ### INT_ARRAY

    public static final TypeRef<int[]> INT_ARRAY

  - ### STRING_ARRAY

    public static final TypeRef<java.lang.String[]> STRING_ARRAY

- ## Constructor Details

  - ### TypeRef

    public TypeRef()
    Constructor.

- ## Method Details

  - ### getType

    public java.lang.reflect.Type getType()
    Gets the type referenced.
    Returns:
      type referenced.

  - ### get

    public static <T> TypeRef<T> get​(java.lang.Class<T> clazz)
    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.