Skip to content

Package: JsonBindingBuilder

JsonBindingBuilder

nameinstructionbranchcomplexitylinemethod
JsonBindingBuilder()
M: 11 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%
build()
M: 5 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getConfig()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getProvider()
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
withConfig(JsonbConfig)
M: 5 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
withProvider(JsonProvider)
M: 5 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%

Coverage

1: /*
2: * Copyright (c) 2016, 2022 Oracle and/or its affiliates. All rights reserved.
3: *
4: * This program and the accompanying materials are made available under the
5: * terms of the Eclipse Public License v. 2.0 which is available at
6: * http://www.eclipse.org/legal/epl-2.0,
7: * or the Eclipse Distribution License v. 1.0 which is available at
8: * http://www.eclipse.org/org/documents/edl-v10.php.
9: *
10: * SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
11: */
12:
13: package org.eclipse.yasson.internal;
14:
15: import java.util.Optional;
16:
17: import jakarta.json.bind.Jsonb;
18: import jakarta.json.bind.JsonbBuilder;
19: import jakarta.json.bind.JsonbConfig;
20: import jakarta.json.spi.JsonProvider;
21:
22: /**
23: * JsonbBuilder implementation.
24: */
25: public class JsonBindingBuilder implements JsonbBuilder {
26: private JsonbConfig config = new JsonbConfig();
27: private JsonProvider provider = null;
28:
29: @Override
30: public JsonbBuilder withConfig(JsonbConfig config) {
31: this.config = config;
32: return this;
33: }
34:
35: @Override
36: public JsonbBuilder withProvider(JsonProvider jsonpProvider) {
37: this.provider = jsonpProvider;
38: return this;
39: }
40:
41: /**
42: * Gets configuration.
43: *
44: * @return configuration.
45: */
46: public JsonbConfig getConfig() {
47: return config;
48: }
49:
50: /**
51: * Gets provider.
52: *
53: * @return Provider.
54: */
55: public Optional<JsonProvider> getProvider() {
56: return Optional.ofNullable(provider);
57: }
58:
59: @Override
60: public Jsonb build() {
61: return new JsonBinding(this);
62: }
63: }