コード例 #1
0
 @Override
 public Object get(Value value, Class<?> clazz, CoderContext context) {
   try {
     return ServerIssue.parseFrom(value.getByteArray());
   } catch (IOException e) {
     throw new IllegalStateException("Unable to read issue from cache", e);
   }
 }
コード例 #2
0
 @Override
 public void put(Value value, Object object, CoderContext context) {
   ServerIssue issue = (ServerIssue) object;
   value.putByteArray(issue.toByteArray());
 }