Class Types

java.lang.Object
org.joda.convert.Types

final class Types extends Object
Utilities for working with Type.
  • Constructor Details

    • Types

      private Types()
  • Method Details

    • newArrayType

      static Type newArrayType(Type componentType)
      Returns the array type of componentType.
    • newParameterizedTypeWithOwner

      static ParameterizedType newParameterizedTypeWithOwner(Type ownerType, Class<?> rawType, Type... arguments)
      Returns a type where rawType is parameterized by arguments and is owned by ownerType.
    • newParameterizedType

      static ParameterizedType newParameterizedType(Class<?> rawType, Type... arguments)
      Returns a type where rawType is parameterized by arguments.
    • newArtificialTypeVariable

      static <D extends GenericDeclaration> TypeVariable<D> newArtificialTypeVariable(D declaration, String name, Type... bounds)
      Returns a new TypeVariable that belongs to declaration with name and bounds.
    • subtypeOf

      static WildcardType subtypeOf(Type upperBound)
      Returns a new WildcardType with upperBound.
    • supertypeOf

      static WildcardType supertypeOf(Type lowerBound)
      Returns a new WildcardType with lowerBound.
    • toString

      static String toString(Type type)
      Returns human readable string representation of type.
      • For array type Foo[], "com.mypackage.Foo[]" are returned.
      • For any class, theClass.getName() are returned.
      • For all other types, type.toString() are returned.
    • getComponentType

      static Type getComponentType(Type type)
    • subtypeOfComponentType

      private static Type subtypeOfComponentType(Type[] bounds)
      Returns ? extends X if any of bounds is a subtype of X[]; or null otherwise.
    • newTypeVariableImpl

      private static <D extends GenericDeclaration> TypeVariable<D> newTypeVariableImpl(D genericDeclaration, String name, Type[] bounds)
    • newProxy

      private static <T> T newProxy(Class<T> interfaceType, InvocationHandler handler)
    • toArray

      private static Type[] toArray(Collection<Type> types)
    • filterUpperBounds

      private static List<Type> filterUpperBounds(List<Type> bounds)
    • disallowPrimitiveType

      private static void disallowPrimitiveType(Type[] types, String usedAs)
    • getArrayClass

      static Class<?> getArrayClass(Class<?> componentType)
      Returns the Class object of arrays with componentType.
    • checkNotNull

      private static <T> T checkNotNull(T reference)
    • checkArgument

      private static void checkArgument(boolean expression)
    • checkArgument

      private static void checkArgument(boolean expression, Object errorMessage)
    • checkArgument

      static void checkArgument(boolean expression, String errorMessageTemplate, Object... errorMessageArgs)
    • format

      private static String format(String template, Object... args)
    • equal

      private static boolean equal(Object obj1, Object obj2)