Skip to content

Package: UpdateResponse

UpdateResponse

nameinstructionbranchcomplexitylinemethod
UpdateResponse(String, TypeDescriptor)
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%
UpdateResponse(String, TypeDescriptor, String)
M: 11 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 4 C: 0
0%
M: 1 C: 0
0%
getDescription()
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%
getException()
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%
setDescription(String)
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
setException(Exception)
M: 4 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) 2017, 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: * Red Hat Inc
13: *******************************************************************************/
14: package org.eclipse.kapua.service.elasticsearch.client.model;
15:
16: /**
17: * Update {@link Response} definition.
18: *
19: * @since 1.0.0
20: */
21: public class UpdateResponse extends Response {
22:
23: /**
24: * The result description.
25: *
26: * @since 1.0.0
27: */
28: private String description;
29:
30: /**
31: * The update exception, if occurred.
32: *
33: * @since 1.0.0
34: */
35: private Exception exception;
36:
37: /**
38: * Positive result constructor (result true)
39: *
40: * @param id The id of the result.
41: * @param typeDescriptor The {@link TypeDescriptor}.
42: * @since 1.0.0
43: */
44: public UpdateResponse(String id, TypeDescriptor typeDescriptor) {
45: super(id, typeDescriptor);
46:
47: setResult(true);
48: }
49:
50: /**
51: * Negative result constructor (result false)
52: *
53: * @param id The id of the result.
54: * @param typeDescriptor The {@link TypeDescriptor}
55: * @param description The result description of the failure.
56: * @since 1.0.0
57: */
58: public UpdateResponse(String id, TypeDescriptor typeDescriptor, String description) {
59: this(id, typeDescriptor);
60:
61: setResult(false);
62: setDescription(description);
63: }
64:
65: /**
66: * Gets the result description.
67: *
68: * @return The result description.
69: * @since 1.0.0
70: */
71: public String getDescription() {
72: return description;
73: }
74:
75: /**
76: * Sets the result description.
77: *
78: * @param description The result description.
79: * @since 1.0.0
80: */
81: public void setDescription(String description) {
82: this.description = description;
83: }
84:
85: /**
86: * Gets the update exception, if occurred.
87: *
88: * @return The update exception, if occurred.
89: * @since 1.3.0
90: */
91: public Throwable getException() {
92: return exception;
93: }
94:
95: /**
96: * Sets the update exception, if occurred.
97: *
98: * @param exception The update exception, if occurred.
99: * @since 1.3.0
100: */
101: public void setException(Exception exception) {
102: this.exception = exception;
103: }
104:
105: }