Skip to content

Package: DeserializerBinding

DeserializerBinding

nameinstructionbranchcomplexitylinemethod
DeserializerBinding(Type, JsonbDeserializer)
M: 7 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%
getComponentClass()
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%
getJsonbDeserializer()
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%

Coverage

1: /*
2: * Copyright (c) 2016, 2020 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.components;
14:
15: import java.lang.reflect.Type;
16:
17: import jakarta.json.bind.serializer.JsonbDeserializer;
18:
19: /**
20: * Component containing deserializer.
21: *
22: * @param <T> type of contained deserializer
23: */
24: public class DeserializerBinding<T> extends AbstractComponentBinding {
25:
26: private final JsonbDeserializer<T> jsonbDeserializer;
27:
28: /**
29: * Creates a new instance.
30: *
31: * @param bindingType Binding type.
32: * @param jsonbDeserializer Deserializer.
33: */
34: public DeserializerBinding(Type bindingType, JsonbDeserializer<T> jsonbDeserializer) {
35: super(bindingType);
36: this.jsonbDeserializer = jsonbDeserializer;
37: }
38:
39: /**
40: * Gets deserializer if any.
41: *
42: * @return Deserializer.
43: */
44: public JsonbDeserializer<T> getJsonbDeserializer() {
45: return jsonbDeserializer;
46: }
47:
48: @Override
49: public Class<?> getComponentClass() {
50: return jsonbDeserializer.getClass();
51: }
52: }