DATAREDIS-302 - Undo breaking change in DecoratingStringHashMapper.

The introduced generic types prevent the DecoratingStringHashMapper from being useful as it can now only be created for mappers of the generic type which was not the original intention.

This breaks the retwis-j sample as well as it seems other implementations see: b0c0d23.

Original pull request: #73.
This commit is contained in:
Christoph Strobl
2014-05-20 10:25:41 +02:00
committed by Thomas Darimont
parent bdea1051de
commit b01fa9fd71

View File

@@ -26,14 +26,16 @@ import java.util.Map;
*/
public class DecoratingStringHashMapper<T> implements HashMapper<T, String, String> {
private final HashMapper<T, String, String> delegate;
private final HashMapper<T, ?, ?> delegate;
public DecoratingStringHashMapper(HashMapper<T, String, String> mapper) {
public DecoratingStringHashMapper(HashMapper<T, ?, ?> mapper) {
this.delegate = mapper;
}
public T fromHash(Map<String, String> hash) {
return delegate.fromHash(hash);
@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
public T fromHash(Map hash) {
return (T) delegate.fromHash(hash);
}
public Map<String, String> toHash(T object) {