@Override public void writeTo(Output output, int number, String value, boolean repeated) throws IOException { output.writeString(number, (CharSequence) value, repeated); }
@Override public void writeString(int fieldNumber, CharSequence value, boolean repeated) throws IOException { output.writeString(fieldNumber, value, repeated); }
@Override public void writeTo(Output output, int number, String value, boolean repeated) throws IOException { output.writeString(number, (CharSequence) value, repeated); }
@Override protected void writeValueTo(Output output, int fieldNumber, String value, boolean repeated) throws IOException { output.writeString(fieldNumber, (CharSequence) value, repeated); }
@Override protected final void writeKeyTo(Output output, int fieldNumber, String value, boolean repeated) throws IOException { output.writeString(fieldNumber, (CharSequence) value, repeated); }
@Override public void writeTo(Output output, int number, BigDecimal value, boolean repeated) throws IOException { output.writeString(number, value.toString(), repeated); }
@Override protected void writeEnumIdTo(Output output, int fieldNumber, Class<?> clazz) throws IOException { output.writeString(fieldNumber, clazz.getName(), false); }
@Override public void writeTo(Output output, int number, BigDecimal value, boolean repeated) throws IOException { output.writeString(number, value.toString(), repeated); }
@Override protected void writeClassIdTo(Output output, Class<?> componentType, boolean array) throws IOException { final int id = array ? RuntimeFieldFactory.ID_CLASS_ARRAY : RuntimeFieldFactory.ID_CLASS; output.writeString(id, componentType.getName(), false); }
@Override protected void writeArrayIdTo(Output output, Class<?> componentType) throws IOException { output.writeString(RuntimeFieldFactory.ID_ARRAY, componentType.getName(), false); }
@Override @SuppressWarnings("unchecked") protected <T> HasDelegate<T> tryWriteDelegateIdTo(Output output, int fieldNumber, Class<T> clazz) throws IOException { final HasDelegate<T> hd = (HasDelegate<T>) delegateMapping.get(clazz .getName()); if (hd == null) return null; output.writeString(fieldNumber, clazz.getName(), false); return hd; }
@Override @SuppressWarnings("unchecked") protected <T> HasDelegate<T> tryWriteDelegateIdTo(Output output, int fieldNumber, Class<T> clazz) throws IOException { final HasDelegate<T> hd = (HasDelegate<T>) delegateMapping.get(clazz .getName()); if (hd == null) return null; output.writeString(fieldNumber, clazz.getName(), false); return hd; }
@Override protected void writeValueTo(Output output, int fieldNumber, String value, boolean repeated) throws IOException { output.writeString(fieldNumber, value, repeated); }
@Override protected <T> HasSchema<T> writePojoIdTo(Output output, int fieldNumber, Class<T> clazz) throws IOException { output.writeString(fieldNumber, clazz.getName(), false); // it is important to return the schema initialized (if it hasn't been). return getSchemaWrapper(clazz, true); }
@Override public void writeTo(Output output, RequiresName message) throws IOException { if (message.name != null) output.writeString(1, (CharSequence) message.name, false); if (message.description != null) output.writeString(2, (CharSequence) message.description, false); }
@Override protected <T> HasSchema<T> writePojoIdTo(Output output, int fieldNumber, Class<T> clazz) throws IOException { output.writeString(fieldNumber, clazz.getName(), false); // it is important to return the schema initialized (if it hasn't been). return getSchemaWrapper(clazz, true); }
@Override public void writeTo(Output output, HasHasBar message) throws IOException { if (message.name != null) output.writeString(1, message.name, false); writeHasBar(output, 2, message.hasBar, false); }
@Override public void transferByteRangeTo(Output output, boolean utf8String, int fieldNumber, boolean repeated) throws IOException { if (utf8String) output.writeString(fieldNumber, readString(), repeated); else output.writeByteArray(fieldNumber, readByteArray(), repeated); }
@Override public void writeTo(Output output, Baz message) throws IOException { if (message.id != 0) output.writeInt32(1, message.id, false); if (message.name != null) output.writeString(2, message.name, false); if (message.timestamp != 0l) output.writeInt64(3, message.timestamp, false); }
@Override public void writeTo(Output output, ClubFounder message) throws IOException { if (message.name != null) output.writeString(1, message.name, false); if (message.club != null) output.writeObject(2, message.club, Club.getSchema(), false); }