/** * Returns a new builder for a {@code DittoHeaders} object which is initialised with the headers the specified * JSON object provides. * * @param jsonObject the JSON object which provides the initial headers. * @return the builder. * @throws NullPointerException if {@code jsonObject} is {@code null}. * @throws IllegalArgumentException if {@code jsonObject} contains an invalid header. */ static DittoHeadersBuilder newBuilder(final JsonObject jsonObject) { return DefaultDittoHeadersBuilder.of(jsonObject); }
/** * Returns a new builder for a {@code DittoHeaders} object which is initialised with the specified headers. * * @param headers the initial headers. * @return the builder. * @throws NullPointerException if {@code headers} is {@code null}. * @throws IllegalArgumentException if {@code headers} contains an invalid key-value-pair. */ static DittoHeadersBuilder newBuilder(final Map<String, String> headers) { return DefaultDittoHeadersBuilder.of(headers); }
/** * Returns a mutable builder with a fluent API for immutable {@code DittoHeaders}. The builder is initialised with * the entries of this instance. * * @return the new builder. */ default DittoHeadersBuilder toBuilder() { return DefaultDittoHeadersBuilder.of(this); }
/** * Returns a mutable builder with a fluent API for immutable {@code DittoHeaders}. The builder is initialised with * the entries of this instance. * * @return the new builder. */ default DittoHeadersBuilder toBuilder() { return DefaultDittoHeadersBuilder.of(this); }
/** * Returns a new builder for a {@code DittoHeaders} object which is initialised with the specified headers. * * @param headers the initial headers. * @return the builder. * @throws NullPointerException if {@code headers} is {@code null}. * @throws IllegalArgumentException if {@code headers} contains an invalid key-value-pair. */ static DittoHeadersBuilder newBuilder(final Map<String, String> headers) { return DefaultDittoHeadersBuilder.of(headers); }
/** * Returns a new builder for a {@code DittoHeaders} object which is initialised with the headers the specified * JSON object provides. * * @param jsonObject the JSON object which provides the initial headers. * @return the builder. * @throws NullPointerException if {@code jsonObject} is {@code null}. * @throws IllegalArgumentException if {@code jsonObject} contains an invalid header. */ static DittoHeadersBuilder newBuilder(final JsonObject jsonObject) { return DefaultDittoHeadersBuilder.of(jsonObject); }
/** * Returns a new instance of {@code DittoHeadersBuilder}. * * @return a builder for creating {@code DittoHeaders} object. */ static DefaultDittoHeadersBuilder newInstance() { return of(new HashMap<>()); }
/** * Returns a new instance of {@code DittoHeadersBuilder}. * * @return a builder for creating {@code DittoHeaders} object. */ static DefaultDittoHeadersBuilder newInstance() { return of(new HashMap<>()); }
/** * Returns a new instance of {@code DittoHeadersBuilder} initialized with the the properties of the given * {@code jsonObject}. * * @param jsonObject the JSON object which provides the initial properties of the builder. * @return a builder for creating {@code DittoHeaders} object. * @throws NullPointerException if {@code jsonObject} is {@code null}. */ static DefaultDittoHeadersBuilder of(final JsonObject jsonObject) { return of(toMap(jsonObject)); }
/** * Returns a new instance of {@code DittoHeadersBuilder} initialized with the the properties of the given * {@code jsonObject}. * * @param jsonObject the JSON object which provides the initial properties of the builder. * @return a builder for creating {@code DittoHeaders} object. * @throws NullPointerException if {@code jsonObject} is {@code null}. */ static DefaultDittoHeadersBuilder of(final JsonObject jsonObject) { return of(toMap(jsonObject)); }