Package org.joda.convert
Class Types
java.lang.Object
org.joda.convert.Types
Utilities for working with
Type.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static enumDecides what owner type to use for constructingParameterizedTypefrom a raw class.private static final class(package private) static enum(package private) static final classPer issue 1635, In JDK 1.7.0_51-b13,TypeVariableImpl#equals(Object)is changed to no longer be equal to custom TypeVariable implementations.private static final classprivate static final classTypes.TypeVariableImpl<D extends GenericDeclaration>private static final classInvocation handler to work around a compatibility problem between Java 7 and Java 8.private static classVisitor pattern to evaluateType.(package private) static final class -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static voidcheckArgument(boolean expression) private static voidcheckArgument(boolean expression, Object errorMessage) (package private) static voidcheckArgument(boolean expression, String errorMessageTemplate, Object... errorMessageArgs) private static <T> TcheckNotNull(T reference) private static voiddisallowPrimitiveType(Type[] types, String usedAs) private static booleanfilterUpperBounds(List<Type> bounds) private static String(package private) static Class<?> getArrayClass(Class<?> componentType) Returns theClassobject of arrays withcomponentType.(package private) static TypegetComponentType(Type type) (package private) static TypenewArrayType(Type componentType) Returns the array type ofcomponentType.(package private) static <D extends GenericDeclaration>
TypeVariable<D> newArtificialTypeVariable(D declaration, String name, Type... bounds) (package private) static ParameterizedTypenewParameterizedType(Class<?> rawType, Type... arguments) Returns a type whererawTypeis parameterized byarguments.(package private) static ParameterizedTypenewParameterizedTypeWithOwner(Type ownerType, Class<?> rawType, Type... arguments) Returns a type whererawTypeis parameterized byargumentsand is owned byownerType.private static <T> TnewProxy(Class<T> interfaceType, InvocationHandler handler) private static <D extends GenericDeclaration>
TypeVariable<D> newTypeVariableImpl(D genericDeclaration, String name, Type[] bounds) (package private) static WildcardTypeReturns a newWildcardTypewithupperBound.private static TypesubtypeOfComponentType(Type[] bounds) Returns? extends Xif any ofboundsis a subtype ofX[]; or null otherwise.(package private) static WildcardTypesupertypeOf(Type lowerBound) Returns a newWildcardTypewithlowerBound.private static Type[]toArray(Collection<Type> types) (package private) static StringReturns human readable string representation oftype.
-
Constructor Details
-
Types
private Types()
-
-
Method Details
-
newArrayType
Returns the array type ofcomponentType. -
newParameterizedTypeWithOwner
static ParameterizedType newParameterizedTypeWithOwner(Type ownerType, Class<?> rawType, Type... arguments) Returns a type whererawTypeis parameterized byargumentsand is owned byownerType. -
newParameterizedType
Returns a type whererawTypeis parameterized byarguments. -
newArtificialTypeVariable
static <D extends GenericDeclaration> TypeVariable<D> newArtificialTypeVariable(D declaration, String name, Type... bounds) -
subtypeOf
Returns a newWildcardTypewithupperBound. -
supertypeOf
Returns a newWildcardTypewithlowerBound. -
toString
Returns human readable string representation oftype.- For array type
Foo[],"com.mypackage.Foo[]"are returned. - For any class,
theClass.getName()are returned. - For all other types,
type.toString()are returned.
- For array type
-
getComponentType
-
subtypeOfComponentType
Returns? extends Xif any ofboundsis a subtype ofX[]; or null otherwise. -
newTypeVariableImpl
private static <D extends GenericDeclaration> TypeVariable<D> newTypeVariableImpl(D genericDeclaration, String name, Type[] bounds) -
newProxy
-
toArray
-
filterUpperBounds
-
disallowPrimitiveType
-
getArrayClass
Returns theClassobject of arrays withcomponentType. -
checkNotNull
private static <T> T checkNotNull(T reference) -
checkArgument
private static void checkArgument(boolean expression) -
checkArgument
-
checkArgument
-
format
-
equal
-