Skip to content

Package: EncodeException

EncodeException

nameinstructionbranchcomplexitylinemethod
EncodeException(Object, String)
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%
EncodeException(Object, String, Throwable)
M: 8 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%
getObject()
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) 2018, 2019 Oracle and/or its affiliates and others.
3: * All rights reserved.
4: *
5: * This program and the accompanying materials are made available under the
6: * terms of the Eclipse Public License v. 2.0, which is available at
7: * http://www.eclipse.org/legal/epl-2.0.
8: *
9: * This Source Code may also be made available under the following Secondary
10: * Licenses when the conditions for such availability set forth in the
11: * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
12: * version 2 with the GNU Classpath Exception, which is available at
13: * https://www.gnu.org/software/classpath/license.html.
14: *
15: * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
16: */
17:
18: package jakarta.websocket;
19:
20: /**
21: * A general exception that occurs when trying to encode a custom object to a string or binary message.
22: *
23: * @author dannycoward
24: */
25: public class EncodeException extends Exception {
26: private final Object object;
27: private static final long serialVersionUID = 006;
28:
29: /**
30: * Constructor with the object being encoded, and the reason why it failed to be.
31: *
32: * @param object the object that could not be encoded.
33: * @param message the reason for the failure.
34: */
35: public EncodeException(Object object, String message) {
36: super(message);
37: this.object = object;
38: }
39:
40: /**
41: * Constructor with the object being encoded, and the reason why it failed to be, and the cause.
42: *
43: * @param object the object that could not be encoded.
44: * @param message the reason for the failure.
45: * @param cause the cause of the problem.
46: */
47: public EncodeException(Object object, String message, Throwable cause) {
48: super(message, cause);
49: this.object = object;
50: }
51:
52: /**
53: * Return the Object that could not be encoded.
54: *
55: * @return the object.
56: */
57: public Object getObject() {
58: return this.object;
59: }
60: }