tmf: Add TextTrace abstract class with trace validation status
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.core / src / org / eclipse / linuxtools / tmf / core / trace / TraceValidationStatus.java
1 /*******************************************************************************
2 * Copyright (c) 2014 Ericsson
3 *
4 * All rights reserved. This program and the accompanying materials are
5 * made available under the terms of the Eclipse Public License v1.0 which
6 * accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
8 *
9 * Contributors:
10 * Patrick Tasse - Initial API and implementation
11 *******************************************************************************/
12
13 package org.eclipse.linuxtools.tmf.core.trace;
14
15 import org.eclipse.core.runtime.Status;
16
17 /**
18 * A class representing the validation status of a trace against a particular
19 * trace type.
20 *
21 * @since 3.0
22 */
23 public class TraceValidationStatus extends Status {
24
25 private int fConfidence;
26
27 /**
28 * Construct a successful validation status with a confidence level
29 *
30 * @param confidence the confidence level, 0 is lowest
31 * @param pluginId the unique identifier of the relevant plug-in
32 */
33 public TraceValidationStatus(int confidence, String pluginId) {
34 super(OK, pluginId, OK_STATUS.getMessage());
35 if (confidence < 0) {
36 throw new IllegalArgumentException();
37 }
38 fConfidence = confidence;
39 }
40
41 /**
42 * Gets the confidence level
43 *
44 * @return the confidence level, 0 is lowest
45 */
46 public int getConfidence() {
47 return fConfidence;
48 }
49 }
This page took 0.031365 seconds and 5 git commands to generate.