org.geotools.util
Interface Converter


public interface Converter

Converts values of one type into another.

Since:
2.4
Author:
Justin Deoliveira, The Open Planning Project
Module:
modules/library/api (gt-api.jar)

Method Summary
<T> T
convert(Object source, Class<T> target)
          Converts an object to an object of another type.
 

Method Detail

convert

<T> T convert(Object source,
              Class<T> target)
          throws Exception
Converts an object to an object of another type.

If the converstion supplied is not supported this method can either throw an exception or return null.

Parameters:
source - The original object, never null
target - The type of the converted object.
Returns:
An instance of target, or null if the conversion could not take place.
Throws:
Exception - If the conversion can not take place.


Copyright © 1996-2009 Geotools. All Rights Reserved.