- 
                Notifications
    You must be signed in to change notification settings 
- Fork 57
          Suppport simple deserialization of Cache
          #116
        
          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
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).
CacheCache
      
Supports deserialization side of
Cachefollowing #112.Notes
Cacheitself heavily relies on builder mechanism throughCacheBuilderso it is most likely we cannot initialize by its subclasses.GuavaMultimapDeserializerLike how [Guava] AllowCacheserialization #112 Cache serialization was implemented.