Package io.quarkus.builder
Class Json.JsonBuilder<T>
- java.lang.Object
-
- io.quarkus.builder.Json.JsonBuilder<T>
-
- Direct Known Subclasses:
Json.JsonArrayBuilder,Json.JsonObjectBuilder
- Enclosing class:
- Json
abstract static class Json.JsonBuilder<T> extends Object
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanignoreEmptyBuilders
-
Constructor Summary
Constructors Constructor Description JsonBuilder(boolean ignoreEmptyBuilders)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description (package private) abstract voidappendTo(Appendable appendable)(package private) abstract Stringbuild()(package private) abstract booleanisEmpty()protected booleanisIgnored(Object value)protected booleanisValuesEmpty(Collection<Object> values)protected abstract Tself()
-
-
-
Constructor Detail
-
JsonBuilder
JsonBuilder(boolean ignoreEmptyBuilders)
- Parameters:
ignoreEmptyBuilders- If set to true all empty builders added to this builder will be ignored duringbuild()
-
-
Method Detail
-
isEmpty
abstract boolean isEmpty()
- Returns:
trueif there are no elements/properties,falseotherwise
-
build
abstract String build() throws IOException
- Returns:
- a string representation
- Throws:
IOException
-
appendTo
abstract void appendTo(Appendable appendable) throws IOException
- Throws:
IOException
-
isIgnored
protected boolean isIgnored(Object value)
- Parameters:
value-- Returns:
trueif the value is null or an empty builder andignoreEmptyBuildersis set totrue,falseotherwise
-
isValuesEmpty
protected boolean isValuesEmpty(Collection<Object> values)
-
self
protected abstract T self()
-
-