gdbtrace: Move plugins to the Trace Compass namespace
[deliverable/tracecompass.git] / org.eclipse.linuxtools.lttng2.control.core / src / org / eclipse / linuxtools / internal / lttng2 / control / core / model / TraceChannelOutputType.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 * Jonathan Rajotte - Initial API and implementation
11 **********************************************************************/
12
13 package org.eclipse.linuxtools.internal.lttng2.control.core.model;
14
15 /**
16 * Trace domain type enumeration.
17 *
18 * @author Jonathan Rajotte
19 */
20 public enum TraceChannelOutputType {
21 /** Channel output type : splice */
22 SPLICE("splice()", "SPLICE" ), //$NON-NLS-1$ //$NON-NLS-2$
23 /** Channel output type : mmap */
24 MMAP("mmap()", "MMAP"), //$NON-NLS-1$ //$NON-NLS-2$
25 /** Channel output type : unknown */
26 UNKNOWN("unknown", "unknown"); //$NON-NLS-1$ //$NON-NLS-2$
27
28 private final String fInName;
29 private final String fInMiName;
30
31 private TraceChannelOutputType(String name, String miName) {
32 fInName = name;
33 fInMiName = miName;
34 }
35
36 /**
37 * Get the type's name
38 *
39 * @return The type's name
40 */
41 public String getInName() {
42 return fInName;
43 }
44
45 /**
46 * Get the type's name
47 *
48 * @return The type's name
49 */
50 public String getInMiName() {
51 return fInMiName;
52 }
53
54 /**
55 * Return the corresponding {@link TraceChannelOutputType} of string miName
56 *
57 * @param name
58 * name of the Trace domain type to look for
59 * @return the corresponding {@link TraceChannelOutputType}
60 */
61 public static TraceChannelOutputType valueOfString(String name) {
62 if (name == null) {
63 throw new IllegalArgumentException();
64 }
65 for (TraceChannelOutputType tdType : TraceChannelOutputType.values()) {
66 boolean isEqual = tdType.getInName().equalsIgnoreCase(name) || tdType.getInMiName().equalsIgnoreCase(name);
67 if (isEqual) {
68 return tdType;
69 }
70 }
71 // Unknown domain
72 return UNKNOWN;
73 }
74 }
This page took 0.032472 seconds and 5 git commands to generate.