@SuppressWarnings("unchecked") static void writeObjectTo(Output output, Object value, Schema<?> currentSchema, IdStrategy strategy) throws IOException { final Class<Object> clazz = (Class<Object>) value.getClass(); final RuntimeFieldFactory<Object> inline = RuntimeFieldFactory .getInline(clazz); if (inline != null) { // scalar value inline.writeTo(output, inline.id, value, false); return; } // AtomicInteger/AtomicLong final Schema<Object> schema = strategy.writePojoIdTo(output, ID_POJO, clazz).getSchema(); if (output instanceof StatefulOutput) { // update using the derived schema. ((StatefulOutput) output).updateLast(schema, currentSchema); } schema.writeTo(output, value); }
@SuppressWarnings("unchecked") static void writeObjectTo(Output output, Object value, Schema<?> currentSchema, IdStrategy strategy) throws IOException { final Class<Object> clazz = (Class<Object>) value.getClass(); final RuntimeFieldFactory<Object> inline = RuntimeFieldFactory .getInline(clazz); if (inline != null) { // scalar value inline.writeTo(output, inline.id, value, false); return; } // AtomicInteger/AtomicLong final Schema<Object> schema = strategy.writePojoIdTo(output, ID_POJO, clazz).getSchema(); if (output instanceof StatefulOutput) { // update using the derived schema. ((StatefulOutput) output).updateLast(schema, currentSchema); } schema.writeTo(output, value); }
@Override public void writeTo(Output output, int number, Map<?, ?> value, boolean repeated) throws IOException { org.writeTo(output, number, value, repeated); }
inline.writeTo(output, inline.id, value, false); return;
inline.writeTo(output, inline.id, value, false); return;
@Override public void writeTo(Output output, int number, Map<?, ?> value, boolean repeated) throws IOException { org.writeTo(output, number, value, repeated); }
@Override public void writeTo(Output output, int number, Map<?, ?> value, boolean repeated) throws IOException { org.writeTo(output, number, value, repeated); }