Module jtrim.query
Package org.jtrim2.concurrent.query
Interface DataConverter<OldDataType,NewDataType>
- Type Parameters:
OldDataType- the type of the object to be convertedNewDataType- the type of the object returned by the conversion
public interface DataConverter<OldDataType,NewDataType>
Defines a conversion from one type to another. The conversion does not need
to be reversible and, of course, there can be multiple conversion defined
from one type to another.
Note that in case this conversion is slow (e.g.: waits for external events,
like reading a file), consider using AsyncDataConverter or simply an
AsyncDataQuery for conversion.
Thread safety
Implementations of this interface are required to be safe to be used by multiple threads concurrently.Synchronization transparency
Implementations of this interface are not required to be synchronization transparent.-
Method Summary
Modifier and TypeMethodDescriptionconvertData(OldDataType data) Converts the data from one type to another as defined by the implementation.
-
Method Details
-
convertData
Converts the data from one type to another as defined by the implementation. Note that the conversion might not be reversible.- Parameters:
data- the object to be converted. This argument can benullif the conversion supports convertingnullvalues.- Returns:
- the converted data as defined by the implementation. This method
may or may not returns
null, depending on the implementation.
-