org.mule.transformer.types
Class CollectionDataType<T>
java.lang.Object
org.mule.transformer.types.SimpleDataType<T>
org.mule.transformer.types.CollectionDataType<T>
- All Implemented Interfaces:
- Serializable, Cloneable, DataType<T>
- Direct Known Subclasses:
- ListDataType, SetDataType
public class CollectionDataType<T>
- extends SimpleDataType<T>
A data type that represents a generified collection. When checked for compatability both the colection type and the
generic item type will be compared.
- Since:
- 3.0
- See Also:
- Serialized Form
CollectionDataType
public CollectionDataType(Class<? extends Collection> collectionType)
- Creates an untyped collection data type
- Parameters:
collectionType
- the collection class type
CollectionDataType
public CollectionDataType(Class<? extends Collection> collectionType,
String mimeType)
CollectionDataType
public CollectionDataType(Class<? extends Collection> collectionType,
Class type,
String mimeType)
CollectionDataType
public CollectionDataType(Class<? extends Collection> collectionType,
Class type)
getItemType
public Class<?> getItemType()
getType
public Class getType()
- Description copied from interface:
DataType
- The object type of the source object to transform.
- Specified by:
getType
in interface DataType<T>
- Overrides:
getType
in class SimpleDataType<T>
- Returns:
- the class object of the source object. This must not be null
createFromMethodReturn
public static CollectionDataType createFromMethodReturn(Method m)
createFromMethodReturn
public static CollectionDataType createFromMethodReturn(Method m,
String mimeType)
createFromMethodParam
public static CollectionDataType createFromMethodParam(Method m,
int paramIndex)
createFromMethodParam
public static CollectionDataType createFromMethodParam(Method m,
int paramIndex,
String mimeType)
isReturnTypeACollection
public static boolean isReturnTypeACollection(Method m)
isParamTypeACollection
public static boolean isParamTypeACollection(Method m,
int paramIndex)
isCompatibleWith
public boolean isCompatibleWith(DataType dataType)
- Description copied from interface:
DataType
- Used to determine if this data type is compatible with the data type passed in. This checks to see if the mime types are
equal and whether the Java types are assignable
- Specified by:
isCompatibleWith
in interface DataType<T>
- Overrides:
isCompatibleWith
in class SimpleDataType<T>
- Parameters:
dataType
- the dataType object to compare with
- Returns:
- true if the mime types are the same and this type can be assigned to the dataType.type.
equals
public boolean equals(Object o)
- Overrides:
equals
in class SimpleDataType<T>
hashCode
public int hashCode()
- Overrides:
hashCode
in class SimpleDataType<T>
toString
public String toString()
- Overrides:
toString
in class SimpleDataType<T>
Copyright © 2003-2014 MuleSoft, Inc.. All Rights Reserved.