tmf: lttngControl: model: add TraceDomainType enum
authorJonathan Rajotte Julien <jonathan.rajotte-julien@ericsson.com>
Mon, 4 Aug 2014 17:18:51 +0000 (13:18 -0400)
committerBernd Hufmann <bernd.hufmann@ericsson.com>
Wed, 27 Aug 2014 15:32:16 +0000 (11:32 -0400)
Change-Id: I1e5e64f8e650705c2284b4ec193a5d0680de4f30
Signed-off-by: Jonathan Rajotte Julien <jonathan.rajotte-julien@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/30993
Tested-by: Hudson CI
Reviewed-by: Bernd Hufmann <bernd.hufmann@ericsson.com>
Tested-by: Bernd Hufmann <bernd.hufmann@ericsson.com>
Reviewed-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/TraceDomainType.java [new file with mode: 0644]

diff --git a/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/TraceDomainType.java b/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/TraceDomainType.java
new file mode 100644 (file)
index 0000000..de52919
--- /dev/null
@@ -0,0 +1,64 @@
+/**********************************************************************
+ * Copyright (c) 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
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *   Jonathan Rajotte - Initial API and implementation
+ **********************************************************************/
+
+package org.eclipse.linuxtools.internal.lttng2.control.core.model;
+
+/**
+ * Trace domain type enumeration.
+ *
+ * @author Jonathan Rajotte
+ */
+public enum TraceDomainType {
+    /** Domain type : ust */
+    UST("ust"), //$NON-NLS-1$
+    /** Domain type : kernel */
+    KERNEL("kernel"), //$NON-NLS-1$
+    /** Domain type : jul */
+    JUL("jul"), //$NON-NLS-1$
+    /** Unknown domain type */
+    UNKNOWN("Unknown domain type"); //$NON-NLS-1$
+
+    private final String fInName;
+
+    private TraceDomainType(String name) {
+        fInName = name;
+    }
+
+    /**
+     * Get the type's name
+     *
+     * @return The type's name
+     */
+    public String getInName() {
+        return fInName;
+    }
+
+    /**
+     * Return the corresponding {@link TraceDomainType} of string miName
+     *
+     * @param miName
+     *            name of the Trace domain type to look for
+     * @return the corresponding {@link TraceDomainType}
+     */
+    public static TraceDomainType valueOfString(String miName) {
+        if (miName == null) {
+            throw new IllegalArgumentException();
+        }
+        for (TraceDomainType tdType : TraceDomainType.values()) {
+            if (tdType.getInName().equalsIgnoreCase(miName)) {
+                return tdType;
+            }
+        }
+        // Unknown domain
+        return UNKNOWN;
+    }
+}
\ No newline at end of file
This page took 0.025356 seconds and 5 git commands to generate.