Module jtrim.query

Interface DataConverter<OldDataType,NewDataType>

Type Parameters:
OldDataType - the type of the object to be converted
NewDataType - 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.
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    Converts the data from one type to another as defined by the implementation.
  • Method Details

    • convertData

      NewDataType convertData(OldDataType data)
      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 be null if the conversion supports converting null values.
      Returns:
      the converted data as defined by the implementation. This method may or may not returns null, depending on the implementation.