Class MoreTypes

org.elasticsearch.common.inject.internal.MoreTypes

public class MoreTypes extends
Static methods for working with types that we aren't publishing in the public Types API.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
     
    static class 
    We cannot serialize the built-in Java member classes, which prevents us from using Members in our exception types.
    static class 
     
    static class 
    The WildcardType interface supports multiple upper bounds and multiple lower bounds.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static []
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static
     type)
    Returns a type that is functionally equal but not necessarily equal according to .
    static boolean
     a,  b)
    Returns true if a and b are equal.
    static
     type, <?> rawType, <?> toResolve)
    Returns the generic supertype for supertype.
    static <?>
     type)
     
    static int
     type)
    Returns the hashCode of type.
    static <T> TypeLiteral<T>
    Returns an equivalent type that's safe for use in a key.
    static
     member)
     
    static <? extends >
     member)
    Returns Field.class, Method.class or Constructor.class.
    static
     type, <?> rawType,  unknown)
     
    static
     member)
    Formats a member as concise string, such as java.util.ArrayList.size, java.util.ArrayList<init>() or java.util.List.remove().
    static
     type)
     

    Methods inherited from class java.lang.

    , , , , , , , , , ,
  • Field Details

    • EMPTY_TYPE_ARRAY

      public static final [] EMPTY_TYPE_ARRAY
  • Method Details

    • makeKeySafe

      public static <T> TypeLiteral<T> makeKeySafe(TypeLiteral<T> type)
      Returns an equivalent type that's safe for use in a key. The returned type will be free of primitive types. Type literals of primitives will return the corresponding wrapper types.
      Throws:
      ConfigurationException - if type contains a type variable
    • canonicalize

      public static  canonicalize( type)
      Returns a type that is functionally equal but not necessarily equal according to .
    • getRawType

      public static <?> getRawType( type)
    • equals

      public static boolean equals( a,  b)
      Returns true if a and b are equal.
    • hashCode

      public static int hashCode( type)
      Returns the hashCode of type.
    • toString

      public static  toString( type)
    • memberType

      public static <? extends > memberType( member)
      Returns Field.class, Method.class or Constructor.class.
    • toString

      public static  toString( member)
      Formats a member as concise string, such as java.util.ArrayList.size, java.util.ArrayList<init>() or java.util.List.remove().
    • memberKey

      public static  memberKey( member)
    • getGenericSupertype

      public static  getGenericSupertype( type, <?> rawType, <?> toResolve)
      Returns the generic supertype for supertype. For example, given a class IntegerSet, the result for when supertype is Set.class is Set<Integer> and the result when the supertype is Collection.class is Collection<Integer>.
    • resolveTypeVariable

      public static  resolveTypeVariable( type, <?> rawType,  unknown)