Exemplo n.º 1
0
 public <T> T to(TypeReference<T> typeReference) {
   try {
     return Mapper.get().readValue(message, typeReference);
   } catch (IOException e) {
     throw new RuntimeException(e);
   }
 }
Exemplo n.º 2
0
 public <T> T to(Class<T> clazz) {
   try {
     return Mapper.get().readValue(message, clazz);
   } catch (IOException e) {
     throw new RuntimeException(e);
   }
 }
Exemplo n.º 3
0
 @SuppressWarnings("rawtypes")
 @Override
 public Object resolve(Object contextObject, String name, ResolutionContext context) {
   if (contextObject == null) {
     return null;
   }
   if (contextObject instanceof Map) {
     Map map = (Map) contextObject;
     return map.get(name);
   }
   if (contextObject instanceof Mapper) {
     Mapper mapper = (Mapper) contextObject;
     return mapper.get(name);
   }
   return null;
 }