6f67292274b475a684c1877c46346d7cc32a80c4
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 * Simon Delisle - Initial API and implementation
11 * Bernd Hufmann - Updated to enum definition
12 * Jonathan Rajotte - Updated enum definition for lttng machine interface
13 **********************************************************************/
15 package org
.eclipse
.linuxtools
.internal
.lttng2
.control
.core
.model
.impl
;
18 * Constants for buffer type.
20 * @author Simon Delisle
21 * @author Bernd Hufmann
24 public enum BufferType
{
25 // ------------------------------------------------------------------------
27 // ------------------------------------------------------------------------
29 * Buffer type : per UID
31 BUFFER_PER_UID("per UID", "PER_UID"), //$NON-NLS-1$ //$NON-NLS-2$
33 * Buffer type : per PID
35 BUFFER_PER_PID("per PID", "PER_PID"), //$NON-NLS-1$ //$NON-NLS-2$
37 * Buffer type : shared
39 BUFFER_SHARED("shared"), //$NON-NLS-1$
41 * If the LTTng version doesn't show the buffer type
43 BUFFER_TYPE_UNKNOWN("information not unavailable"); //$NON-NLS-1$
45 // ------------------------------------------------------------------------
47 // ------------------------------------------------------------------------
51 private final String fInName
;
54 * Name of the machine interface enum
56 private final String fInMiName
;
58 // ------------------------------------------------------------------------
60 // ------------------------------------------------------------------------
68 private BufferType(String name
, String miName
) {
73 private BufferType(String name
) {
75 fInMiName
= ""; //$NON-NLS-1$
78 // ------------------------------------------------------------------------
80 // ------------------------------------------------------------------------
84 public String
getInName() {
89 * @return machine interface buffer name
91 public String
getInMiName() {
96 // ------------------------------------------------------------------------
98 // -------------------------------------------------------------------------
101 * the string representation of the type
102 * @return enum BufferType of the corresponding type
104 public static BufferType
valueOfString(String name
) {
106 throw new IllegalArgumentException();
108 for (BufferType bufferType
: BufferType
.values()) {
109 boolean isEqual
= bufferType
.getInName().equalsIgnoreCase(name
) || bufferType
.getInMiName().equalsIgnoreCase(name
);
114 return BUFFER_TYPE_UNKNOWN
;
This page took 0.038386 seconds and 5 git commands to generate.