Skip to content

Package: DeviceManagementResponseContentException

DeviceManagementResponseContentException

nameinstructionbranchcomplexitylinemethod
DeviceManagementResponseContentException(KapuaResponsePayload)
M: 13 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%
DeviceManagementResponseContentException(Throwable, KapuaResponsePayload)
M: 14 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%
getResponsePayload()
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) 2020, 2022 Eurotech and/or its affiliates and others
3: *
4: * This program and the accompanying materials are made
5: * available under the terms of the Eclipse Public License 2.0
6: * which is available at https://www.eclipse.org/legal/epl-2.0/
7: *
8: * SPDX-License-Identifier: EPL-2.0
9: *
10: * Contributors:
11: * Eurotech - initial API and implementation
12: *******************************************************************************/
13: package org.eclipse.kapua.service.device.management.exception;
14:
15: import org.eclipse.kapua.service.device.management.message.response.KapuaResponseMessage;
16: import org.eclipse.kapua.service.device.management.message.response.KapuaResponsePayload;
17:
18: import javax.validation.constraints.NotNull;
19: import javax.validation.constraints.Null;
20:
21: /**
22: * {@link DeviceManagementResponseException} to throw when the content of the {@link KapuaResponseMessage} cannot be parsed.
23: *
24: * @since 1.5.0
25: */
26: public class DeviceManagementResponseContentException extends DeviceManagementResponseException {
27:
28: private static final long serialVersionUID = -5787008473862756065L;
29:
30: private final KapuaResponsePayload responsePayload;
31:
32: /**
33: * Constructor.
34: *
35: * @param responsePayload the invalid {@link KapuaResponsePayload}.
36: */
37: public DeviceManagementResponseContentException(@Null KapuaResponsePayload responsePayload) {
38: super(DeviceManagementErrorCodes.RESPONSE_CONTENT, responsePayload);
39:
40: this.responsePayload = responsePayload;
41: }
42:
43: /**
44: * Constructor.
45: *
46: * @param cause the root cause of the {@link Exception}.
47: * @param responsePayload the invalid {@link KapuaResponsePayload}.
48: */
49: public DeviceManagementResponseContentException(@NotNull Throwable cause, @Null KapuaResponsePayload responsePayload) {
50: super(DeviceManagementErrorCodes.RESPONSE_CONTENT, cause, responsePayload);
51:
52: this.responsePayload = responsePayload;
53: }
54:
55: /**
56: * Gets the {@link KapuaResponsePayload}
57: *
58: * @return The {@link KapuaResponsePayload}
59: */
60: public KapuaResponsePayload getResponsePayload() {
61: return responsePayload;
62: }
63: }