Spring Data Commons

org.springframework.data.convert
Interface TypeMapper<S>

All Known Implementing Classes:
DefaultTypeMapper

public interface TypeMapper<S>

Interface to define strategies how to store type information in a store specific sink or source.

Author:
Oliver Gierke

Method Summary
 TypeInformation<?> readType(S source)
          Reads the TypeInformation from the given source.
<T> TypeInformation<? extends T>
readType(S source, TypeInformation<T> defaultType)
          Returns the TypeInformation from the given source if it is a more concrete type than the given default one.
 void writeType(Class<?> type, S dbObject)
          Writes type information for the given type into the given sink.
 void writeType(TypeInformation<?> type, S dbObject)
          Writes type information for the given TypeInformation into the given sink.
 

Method Detail

readType

TypeInformation<?> readType(S source)
Reads the TypeInformation from the given source.

Parameters:
source - must not be null.
Returns:

readType

<T> TypeInformation<? extends T> readType(S source,
                                          TypeInformation<T> defaultType)
Returns the TypeInformation from the given source if it is a more concrete type than the given default one.

Parameters:
source - must not be null.
defaultType -
Returns:

writeType

void writeType(Class<?> type,
               S dbObject)
Writes type information for the given type into the given sink.

Parameters:
type - must not be null.
dbObject - must not be null.

writeType

void writeType(TypeInformation<?> type,
               S dbObject)
Writes type information for the given TypeInformation into the given sink.

Parameters:
type - must not be null.
dbObject - must not be null.

Spring Data Commons

Copyright © 2012. All Rights Reserved.