org.mule.transformer.types
Class SimpleDataType<T>
java.lang.Object
org.mule.transformer.types.SimpleDataType<T>
- All Implemented Interfaces:
- DataType<T>
- Direct Known Subclasses:
- CollectionDataType
public class SimpleDataType<T>
- extends Object
- implements DataType<T>
A data type that simply wraps a Java type. This type also allows a mime type to be associated
with the Java type.
type
protected Class<T> type
mimeType
protected String mimeType
SimpleDataType
public SimpleDataType(Class type,
String mimeType)
SimpleDataType
public SimpleDataType(Class<T> type)
getType
public Class<T> getType()
- Description copied from interface:
DataType
- The object type of the source object to transform.
- Specified by:
getType in interface DataType<T>
- Returns:
- the class object of the source object. This must not be null
getMimeType
public String getMimeType()
- Description copied from interface:
DataType
- The mime type of the the source object to transform.
- Specified by:
getMimeType in interface DataType<T>
- Returns:
- the mime type of the source object. This may be null if the mime type is not known, or if the mime type is
not needed
setMimeType
public void setMimeType(String mimeType)
- Description copied from interface:
DataType
- The mime type of the the source object to transform.
- Specified by:
setMimeType in interface DataType<T>
- Parameters:
mimeType - the mime type of the source object. This may be null if the mime type is not known, or if the mime type is
not needed
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>
- 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 Object
hashCode
public int hashCode()
- Overrides:
hashCode in class Object
toString
public String toString()
- Overrides:
toString in class Object
Copyright © 2003-2010 MuleSoft, Inc.. All Rights Reserved.