Class ClassTypePair


  • public final class ClassTypePair
    extends java.lang.Object
    A pair of raw class and the related type.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.Class<?> rawClass  
      private java.lang.reflect.Type type  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private ClassTypePair​(java.lang.Class<?> c, java.lang.reflect.Type t)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static ClassTypePair of​(java.lang.Class<?> rawClass)
      Create new type-class pair for a non-generic class.
      static ClassTypePair of​(java.lang.Class<?> rawClass, java.lang.reflect.Type type)
      Create new type-class pair.
      java.lang.Class<?> rawClass()
      Get the raw class of the type.
      java.lang.reflect.Type type()
      Get the actual type behind the raw class.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • type

        private final java.lang.reflect.Type type
      • rawClass

        private final java.lang.Class<?> rawClass
    • Constructor Detail

      • ClassTypePair

        private ClassTypePair​(java.lang.Class<?> c,
                              java.lang.reflect.Type t)
    • Method Detail

      • rawClass

        public java.lang.Class<?> rawClass()
        Get the raw class of the type.
        Returns:
        raw class of the type.
      • type

        public java.lang.reflect.Type type()
        Get the actual type behind the raw class.
        Returns:
        the actual type behind the raw class.
      • of

        public static ClassTypePair of​(java.lang.Class<?> rawClass)
        Create new type-class pair for a non-generic class.
        Parameters:
        rawClass - (raw) class representing the non-generic type.
        Returns:
        new non-generic type-class pair.
      • of

        public static ClassTypePair of​(java.lang.Class<?> rawClass,
                                       java.lang.reflect.Type type)
        Create new type-class pair.
        Parameters:
        rawClass - raw class representing the type.
        type - type behind the class.
        Returns:
        new type-class pair.