T
- - type of object to append.@ParametersAreNonnullByDefault @FunctionalInterface public interface ObjectAppender<T> extends BiConsumer<T,Appendable>
Modifier and Type | Field and Description |
---|---|
static ObjectAppender<Object> |
TOSTRING_APPENDER
A simple Object appender that invokes the toString method of the object and writes the object out.
|
Modifier and Type | Method and Description |
---|---|
default void |
accept(T object,
Appendable appendTo) |
void |
append(T object,
Appendable appendTo)
Write an Object to a char stream.
|
default void |
append(T object,
Appendable appendTo,
ObjectAppenderSupplier appenderSupplier)
Method to overwrite for implementing apenders for container objects.
|
static void |
appendNullable(Object o,
Appendable appendTo,
ObjectAppenderSupplier appenderSupplier) |
static void |
appendNullableJson(Object o,
Appendable appendTo,
ObjectAppenderSupplier appenderSupplier) |
default CoreTextMediaType |
getAppendedType()
the MimeType of the format used to write the Object.
|
default String |
toString(T object) |
andThen
static final ObjectAppender<Object> TOSTRING_APPENDER
default CoreTextMediaType getAppendedType()
void append(T object, Appendable appendTo) throws IOException
object
- appendTo
- IOException
static void appendNullable(@Nullable Object o, Appendable appendTo, ObjectAppenderSupplier appenderSupplier) throws IOException
IOException
static void appendNullableJson(@Nullable Object o, Appendable appendTo, ObjectAppenderSupplier appenderSupplier) throws IOException
IOException
default void append(T object, Appendable appendTo, ObjectAppenderSupplier appenderSupplier) throws IOException
IOException
default void accept(T object, Appendable appendTo)
accept
in interface BiConsumer<T,Appendable>
Copyright © 2021 SPF4J. All rights reserved.