public final class DataType extends Object
Type, but also
provides information about its parametrized generic types and
DataQualifier| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj)
Defines equality by checking that the given object is a
DataType with matching
getRawType() and getQualifier(), which also
returns a getGenericTypes() which every element (if any) also matches
the one in this instance |
DataType[] |
getGenericTypes()
An array of nested
DataTypes which represent the
parametrized types for the type returned by getRawType() |
String |
getName()
Returns the type's name
|
DataQualifier |
getQualifier()
A qualifier for the represented type
|
Class<?> |
getRawType()
Returns the
Class for the type described by this instance |
DataType |
getSuperclass() |
int |
hashCode()
Calculates this instance's hash code by considering
the
getRawType(), getQualifier() and the individual
hashCode of each element in getGenericTypes(). |
boolean |
isAssignableFrom(DataType dataType) |
static DataType |
of(Class<?> clazz)
Returns a new
DataType that
represents the given type. |
static DataType |
of(Class<?> clazz,
Class<?>... genericTypes)
Returns a new
DataType that
represents the given type with the optional generic types. |
static DataType |
of(Class<?> clazz,
DataType... genericTypes)
Returns a new
DataType that
represents the given class and has the already provided DataTypes
as getGenericTypes() |
public static DataType of(Class<?> clazz)
DataType that
represents the given type. The returned instance will return an empty array
when queried for getGenericTypes()clazz - a not null ClassDataTypeIllegalArgumentException - if the argument is nullpublic static DataType of(Class<?> clazz, Class<?>... genericTypes)
DataType that
represents the given type with the optional generic types.clazz - a not null ClassgenericTypes - an optional array of generic types accessible through getGenericTypes()DataTypeIllegalArgumentException - if the argument is nullpublic static DataType of(Class<?> clazz, DataType... genericTypes)
DataType that
represents the given class and has the already provided DataTypes
as getGenericTypes()clazz - a not null ClassgenericTypes - an optional array of DataType types accessible through getGenericTypes()DataTypeIllegalArgumentException - if the argument is nullpublic boolean isAssignableFrom(DataType dataType)
public Class<?> getRawType()
Class for the type described by this instancenull Classpublic DataType[] getGenericTypes()
DataTypes which represent the
parametrized types for the type returned by getRawType()DataType. It might be empty but it will not be
nullpublic DataQualifier getQualifier()
DataQualifierpublic DataType getSuperclass()
public boolean equals(Object obj)
DataType with matching
getRawType() and getQualifier(), which also
returns a getGenericTypes() which every element (if any) also matches
the one in this instancepublic int hashCode()
getRawType(), getQualifier() and the individual
hashCode of each element in getGenericTypes(). If the generic types
array is empty, then it's not considered.Copyright © 2015 MuleSoft, Inc.. All rights reserved.