/**********************************************************************
- * Copyright (c) 2012, 2013 Ericsson
+ * Copyright (c) 2012, 2014 Ericsson
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License v1.0 which
* Contributors:
* Bernd Hufmann - Initial API and implementation
**********************************************************************/
+
package org.eclipse.linuxtools.internal.lttng2.control.core.model;
/**
- * <p>
* Trace event type enumeration.
- * </p>
*
* @author Bernd Hufmann
*/
/** Event type: syscall */
SYSCALL("syscall"), //$NON-NLS-1$
/** Event type: probe */
- PROBE("probe"), //$NON-NLS-1$
+ PROBE("probe"), //$NON-NLS-1$
/** Event type: function */
FUNCTION("function"), //$NON-NLS-1$
/** Event type unknown */
public String getInName() {
return fInName;
}
-}
+ /**
+ * Return the corresponding {@link TraceEventType} of string miName
+ *
+ * @param name
+ * name of the {@link TraceEventType} to look for
+ * @return the corresponding {@link TraceEventType}
+ */
+ public static TraceEventType valueOfString(String name) {
+ if (name == null) {
+ throw new IllegalArgumentException();
+ }
+ for (TraceEventType teType : TraceEventType.values()) {
+ if (teType.getInName().equalsIgnoreCase(name)) {
+ return teType;
+ }
+ }
+ return UNKNOWN;
+ }
+}