1 /*******************************************************************************
2 * Copyright (c) 2013, 2014 Ericsson
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
10 * Matthew Khouzam - Initial API and implementation
11 *******************************************************************************/
13 package org
.eclipse
.linuxtools
.tmf
.core
.project
.model
;
16 * Trace import helper class
18 * @author Matthew Khouzam
21 public class TraceValidationHelper
implements Comparable
<TraceValidationHelper
> {
23 private final String fTraceToScan
;
24 private final String fTraceType
;
27 * Trace To validate constructor
30 * the path of the trace
32 * the trace type of the trace to add (canonical name)
34 public TraceValidationHelper(String traceToScan
, String traceType
) {
35 this.fTraceToScan
= traceToScan
;
36 this.fTraceType
= traceType
;
40 * @return the trace filename
42 public String
getTraceToScan() {
47 * @return the trace type canonical name
49 public String
getTraceType() {
54 public int hashCode() {
57 result
= prime
* result
+ ((fTraceToScan
== null) ?
0 : fTraceToScan
.hashCode());
58 result
= prime
* result
+ ((fTraceType
== null) ?
0 : fTraceType
.hashCode());
63 public boolean equals(Object obj
) {
70 if (!(obj
instanceof TraceValidationHelper
)) {
73 TraceValidationHelper other
= (TraceValidationHelper
) obj
;
74 if (fTraceToScan
== null) {
75 if (other
.fTraceToScan
!= null) {
78 } else if (!fTraceToScan
.equals(other
.fTraceToScan
)) {
81 if (fTraceType
== null) {
82 if (other
.fTraceType
!= null) {
85 } else if (!fTraceType
.equals(other
.fTraceType
)) {
92 public int compareTo(TraceValidationHelper o
) {
93 int retVal
= fTraceToScan
.compareTo(o
.getTraceToScan());
95 retVal
= fTraceType
.compareTo(o
.fTraceType
);