-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Suppport simple deserialization of Cache
#116
Conversation
return deserializeContents(p, ctxt); | ||
} | ||
|
||
private T deserializeContents(JsonParser p, DeserializationContext ctxt) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Referenced most from
Line 155 in 66ee959
private T deserializeContents(JsonParser p, DeserializationContext ctxt) |
p.nextToken(); | ||
|
||
final Object value; | ||
if (p.currentToken() == JsonToken.VALUE_NULL) { | ||
if (skipNullValues) { | ||
continue; | ||
} | ||
value = nullProvider.getNullValue(ctxt); | ||
} else if (elementTypeDeserializer != null) { | ||
value = elementDeserializer.deserializeWithType(p, ctxt, elementTypeDeserializer); | ||
} else { | ||
value = elementDeserializer.deserialize(p, ctxt); | ||
} | ||
cache.put(key, value); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Referenced most from...
Exception this part where we do not assume the value is array like
Line 178 in 66ee959
expect(p, JsonToken.START_ARRAY); |
|
||
public void testGuavaCacheApi() throws Exception { | ||
Cache<String, String> cache = CacheBuilder.newBuilder().build(); | ||
// Cache does not allow null key |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am ok with this, but in general it's not necessary to test dependencies of a library (they are assumed to work as specified).
Cache
Cache
Supports deserialization side of
Cache
following #112.Notes
Cache
itself heavily relies on builder mechanism throughCacheBuilder
so it is most likely we cannot initialize by its subclasses.GuavaMultimapDeserializer
Like how [Guava] AllowCache
serialization #112 Cache serialization was implemented.