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
.tracecompass
.tmf
.core
.project
.model
;
15 import static org
.eclipse
.tracecompass
.common
.core
.NonNullUtils
.equalsNullable
;
18 * Trace import helper class
20 * @author Matthew Khouzam
22 public class TraceValidationHelper
implements Comparable
<TraceValidationHelper
> {
24 private final String fTraceToScan
;
25 private final String fTraceType
;
28 * Trace To validate constructor
31 * the path of the trace
33 * the trace type of the trace to add (canonical name)
35 public TraceValidationHelper(String traceToScan
, String traceType
) {
36 this.fTraceToScan
= traceToScan
;
37 this.fTraceType
= traceType
;
41 * @return the trace filename
43 public String
getTraceToScan() {
48 * @return the trace type canonical name
50 public String
getTraceType() {
55 public int hashCode() {
58 result
= prime
* result
+ ((fTraceToScan
== null) ?
0 : fTraceToScan
.hashCode());
59 result
= prime
* result
+ ((fTraceType
== null) ?
0 : fTraceType
.hashCode());
64 public boolean equals(Object obj
) {
71 if (!(obj
instanceof TraceValidationHelper
)) {
74 TraceValidationHelper other
= (TraceValidationHelper
) obj
;
75 if (!equalsNullable(fTraceToScan
, other
.fTraceToScan
)) {
78 if(!equalsNullable(fTraceType
, other
.fTraceType
)){
85 public int compareTo(TraceValidationHelper o
) {
86 int retVal
= fTraceToScan
.compareTo(o
.getTraceToScan());
88 retVal
= fTraceType
.compareTo(o
.fTraceType
);