Polishing.

Reduce constructor visibility and add tests with user provided ObjectMapper.

Original Pull Request: #2332
This commit is contained in:
Christoph Strobl
2022-07-12 07:27:00 +02:00
parent c013a63ba9
commit a55c73faeb
2 changed files with 40 additions and 5 deletions

View File

@@ -242,6 +242,9 @@ public class GenericJackson2JsonRedisSerializer implements RedisSerializer<Objec
return typeResolver.resolveType(source, type);
}
/**
* @since 3.0
*/
static class TypeResolver {
// need a separate instance to bypass class hint checks
@@ -250,7 +253,7 @@ public class GenericJackson2JsonRedisSerializer implements RedisSerializer<Objec
private final Supplier<TypeFactory> typeFactory;
private final Supplier<String> hintName;
public TypeResolver(Supplier<TypeFactory> typeFactory, Supplier<String> hintName) {
TypeResolver(Supplier<TypeFactory> typeFactory, Supplier<String> hintName) {
this.typeFactory = typeFactory;
this.hintName = hintName;
@@ -271,7 +274,6 @@ public class GenericJackson2JsonRedisSerializer implements RedisSerializer<Objec
return constructType(type);
}
}
/**
@@ -309,5 +311,4 @@ public class GenericJackson2JsonRedisSerializer implements RedisSerializer<Objec
serialize(value, gen, serializers);
}
}
}