@Test public void write_null_absent() throws Exception { IntOptionPropertyAdapter adapter = builder .withNullStyle(NullStyle.ABSENT) .build(); MockValue writer = new MockValue("ABSENT"); adapter.write(new IntOption(), writer); assertThat(writer.get(), is("ABSENT")); }
@Override public void write(T property, ValueWriter writer) throws IOException { if (property.isNull()) { if (nullStyle == NullStyle.VALUE) { writer.writeNull(); } } else { doWrite(property, writer); } }
ValueOptionPropertyAdapter implements PropertyAdapter<T> { @Override public void write(T property, ValueWriter writer) throws IOException { if (property.isNull()) { if (nullStyle == NullStyle.VALUE) { writer.writeNull(); } } else { doWrite(property, writer); } } }
ValueOptionPropertyAdapter implements PropertyAdapter<T> { @Override public void write(T property, ValueWriter writer) throws IOException { if (property.isNull()) { if (nullStyle == NullStyle.VALUE) { writer.writeNull(); } } else { doWrite(property, writer); } } protected  ValueOptionPropertyAdapter(BuilderBase<?, ?> builder); }
ValueOptionPropertyAdapter implements PropertyAdapter<T> { @Override public void write(T property, ValueWriter writer) throws IOException { if (property.isNull()) { if (nullStyle == NullStyle.VALUE) { writer.writeNull(); } } else { doWrite(property, writer); } } protected  ValueOptionPropertyAdapter(BuilderBase<?, ?> builder); @SuppressWarnings("deprecation") @Override void absent(T property); @Override final void read(ValueReader reader, T property); @Override void write(T property, ValueWriter writer); }
ValueOptionPropertyAdapter implements PropertyAdapter<T> { @Override public void write(T property, ValueWriter writer) throws IOException { if (property.isNull()) { if (nullStyle == NullStyle.VALUE) { writer.writeNull(); } } else { doWrite(property, writer); } } protected  ValueOptionPropertyAdapter(BuilderBase<?, ?> builder); @SuppressWarnings("deprecation") @Override void absent(T property); @Override final void read(ValueReader reader, T property); @Override void write(T property, ValueWriter writer); static final NullStyle DEFAULT_NULL_STYLE; }