Skip to content

Package: StatusReport

StatusReport

nameinstructionbranchcomplexitylinemethod
StatusReport(Status)
M: 0 C: 6
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 3
100%
M: 0 C: 1
100%
getException()
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%
getMessage()
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%
getSeverity()
M: 0 C: 4
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
hasException()
M: 8 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2011-2014 EclipseSource Muenchen GmbH and others.
3: *
4: * All rights reserved. This program and the accompanying materials
5: * are made available under the terms of the Eclipse Public License 2.0
6: * which accompanies this distribution, and is available at
7: * https://www.eclipse.org/legal/epl-2.0/
8: *
9: * SPDX-License-Identifier: EPL-2.0
10: *
11: * Contributors:
12: * Edgar Mueller - initial API and implementation
13: ******************************************************************************/
14: package org.eclipse.emf.ecp.view.spi.model.reporting;
15:
16: import org.eclipse.core.runtime.Status;
17: import org.eclipse.emfforms.spi.common.report.AbstractReport;
18:
19: /**
20: * A {@link Status} that may be passed to the report service.
21: *
22: * @author emueller
23: * @since 1.5
24: */
25: public class StatusReport extends AbstractReport {
26:
27:         private final Status status;
28:
29:         /**
30:          * Constructor.
31:          *
32:          * @param status
33:          * the status to be wrapped
34:          */
35:         public StatusReport(Status status) {
36:                 this.status = status;
37:         }
38:
39:         /**
40:          *
41:          * {@inheritDoc}
42:          *
43:          * @see org.eclipse.emfforms.spi.common.report.AbstractReport#getMessage()
44:          */
45:         @Override
46:         public String getMessage() {
47:                 return status.getMessage();
48:         }
49:
50:         /**
51:          *
52:          * {@inheritDoc}
53:          *
54:          * @see org.eclipse.emfforms.spi.common.report.AbstractReport#hasException()
55:          */
56:         @Override
57:         public boolean hasException() {
58:•                return status.getException() != null;
59:         }
60:
61:         /**
62:          *
63:          * {@inheritDoc}
64:          *
65:          * @see org.eclipse.emfforms.spi.common.report.AbstractReport#getException()
66:          */
67:         @Override
68:         public Throwable getException() {
69:                 return status.getException();
70:         }
71:
72:         /**
73:          *
74:          * {@inheritDoc}
75:          *
76:          * @see org.eclipse.emfforms.spi.common.report.AbstractReport#getSeverity()
77:          */
78:         @Override
79:         public int getSeverity() {
80:                 return status.getSeverity();
81:         }
82:
83: }