Class Types

java.lang.Object
org.eclipse.gef.common.reflect.Types

public class Types extends Object
Utilities around TypeToken
  • Constructor Details

    • Types

      public Types()
  • Method Details

    • deserialize

      public static final TypeToken<?> deserialize(String string)
      Deserializes the given String-representation in Base64 encoding into a TypeToken.
      Parameters:
      string - The String-representation to deserialize.
      Returns:
      The deserialized TypeToken.
    • isAssignable

      public static final boolean isAssignable(TypeToken<?> superType, TypeToken<?> subType)
      Returns whether the given 'candidate' superType is a super type of the given 'candidate' subtype. This is replacement for TypeToken.isAssignableFrom(TypeToken), which has been deprecated and replaced by TypeToken.isSuperTypeOf(TypeToken) in Google Guava 19.0.0. As we want to support various Google Guava versions from 15.0.0 onwards, this methods delegates to the appropriate implementation using reflection.
      Parameters:
      superType - The 'candidate' superType.
      subType - The 'candidate' subType.
      Returns:
      true when the given 'candidate' superType is indeed a super type of the given 'candidate' subType, false otherwise.
    • serialize

      public static final String serialize(TypeToken<?> typeToken)
      Serializes a given TypeToken into a String representation.
      Parameters:
      typeToken - The TypeToken to serialize.
      Returns:
      The string representation of the TypeToken encoded in Base64.