Package com.globalmentor.model
Interface TypeConverter
- All Known Implementing Classes:
DefaultTypeConverter
public interface TypeConverter
Converts an object from one type to another.
- Author:
- Garret Wilson
-
Method Summary
-
Method Details
-
convert
Converts an object from one type to another. If the object is already of the correct type, no action occurs.- Type Parameters:
T
- The type of object required.- Parameters:
object
- The object to convert.type
- The class representing required type of the object.- Returns:
- The object as the required type, or
null
if the object cannot be converted to the required type. - Throws:
NullPointerException
- if the given object isnull
.IllegalArgumentException
- if the given object should be able to be converted to the required type but something about its state, format, or contents prevented the conversion.
-