Exemple #1
0
 static {
   ImmutableMap.Builder<Class<?>, EventDataType> builder = ImmutableMap.builder();
   for (EventDataType eventDataType : EventDataType.values()) {
     Class<?> dataType = eventDataType.getType();
     builder.put(dataType, eventDataType);
     if (Primitives.isWrapperType(dataType)) {
       builder.put(Primitives.unwrap(dataType), eventDataType);
     }
   }
   byType = builder.build();
 }
 private void writeFieldValue(JsonGenerator jsonGenerator, Object value, Deque<Object> objectStack)
     throws IOException {
   if (eventDataType != null) {
     eventDataType.writeFieldValue(jsonGenerator, value);
   } else {
     validateFieldValueType(value, nestedType.getEventClass());
     writeObject(jsonGenerator, value, objectStack);
   }
 }