Class TypeKey<T>

java.lang.Object
com.googlecode.objectify.impl.translate.TypeKey<T>

public class TypeKey<T>
extends Object

Unique identifier for a translator instance. Important so we can re-use translators as we navigate the tree, allowing us to store recursive structures.

Author:
Jeff Schnitzer
  • Constructor Details

    • TypeKey

      public TypeKey(Type type)
    • TypeKey

      public TypeKey(Type type, TypeKey previous)
      Create a new typekey for a new type but which preserves characteristics of the old typekey (ie annotations). This is used when creating a new typekey for component types.
    • TypeKey

      public TypeKey(Property prop)
      Create a typekey from a property
  • Method Details

    • getTypeAsClass

      public Class<T> getTypeAsClass()
      Get the basic class through erasure.
    • getAnnotation

      public <A extends Annotation> A getAnnotation(Class<A> annotationType)
      Gets the annotation that has the specified type, or null if there isn't one
    • isAnnotationPresent

      public boolean isAnnotationPresent(Class<? extends Annotation> annotationType)
      Returns:
      true if the annotation is present
    • getAnnotationAnywhere

      public <A extends Annotation> A getAnnotationAnywhere(Class<A> annotationType)
      Checks not only the listed annotations but also annotations on the class.
    • isAssignableTo

      public boolean isAssignableTo(Class<?> superclass)
      Can this type be assigned to a variable with the specified type?