Package org.eclipse.gef.common.reflect
Class Types
- java.lang.Object
-
- org.eclipse.gef.common.reflect.Types
-
public class Types extends java.lang.ObjectUtilities aroundTypeToken
-
-
Constructor Summary
Constructors Constructor Description Types()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static TypeToken<?>deserialize(java.lang.String string)Deserializes the givenString-representation in Base64 encoding into aTypeToken.static booleanisAssignable(TypeToken<?> superType, TypeToken<?> subType)Returns whether the given 'candidate' superType is a super type of the given 'candidate' subtype.static java.lang.Stringserialize(TypeToken<?> typeToken)Serializes a givenTypeTokeninto aStringrepresentation.
-
-
-
Method Detail
-
deserialize
public static final TypeToken<?> deserialize(java.lang.String string)
Deserializes the givenString-representation in Base64 encoding into aTypeToken.- Parameters:
string- TheString-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:
truewhen the given 'candidate' superType is indeed a super type of the given 'candidate' subType,falseotherwise.
-
-