1 /**********************************************************************
2 * Copyright (c) 2012, 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 * Bernd Hufmann - Initial API and implementation
11 *********************************************************************/
12 package org
.eclipse
.linuxtools
.internal
.lttng2
.control
.core
.model
;
16 * Type of log Level enumeration.
18 * @author Bernd Hufmann
20 public enum LogLevelType
{
22 // ------------------------------------------------------------------------
24 // ------------------------------------------------------------------------
25 /** range of log levels [0,logLevel] */
26 LOGLEVEL("<=", "RANGE"), //$NON-NLS-1$ //$NON-NLS-2$
29 LOGLEVEL_ALL("", "ALL"), //$NON-NLS-1$//$NON-NLS-2$
31 /** single log level */
32 LOGLEVEL_ONLY("==", "SINGLE"), //$NON-NLS-1$ //$NON-NLS-2$
35 LOGLEVEL_NONE("", "UNKNOWN"); //$NON-NLS-1$ //$NON-NLS-2$
37 // ------------------------------------------------------------------------
39 // ------------------------------------------------------------------------
47 private LogLevelType(String shortName
, String miName
) {
48 fShortName
= shortName
;
52 // ------------------------------------------------------------------------
54 // ------------------------------------------------------------------------
58 private final String fShortName
;
59 private final String fMiName
;
61 // ------------------------------------------------------------------------
63 // ------------------------------------------------------------------------
65 * @return short string
67 public String
getShortName() {
72 * @return machine interface name string
74 public String
getMiName() {
78 // ------------------------------------------------------------------------
80 // ------------------------------------------------------------------------
82 * Return the corresponding {@link LogLevelType} to String "name"
85 * String to compare to retrieve the good LogLevelType
86 * @return the corresponding {@link LogLevelType}
88 public static LogLevelType
valueOfString(String name
) {
90 throw new IllegalArgumentException();
92 for (LogLevelType lltype
: LogLevelType
.values()) {
93 if (!lltype
.equals(LOGLEVEL_NONE
)) {
94 boolean isEqual
= lltype
.fShortName
.equalsIgnoreCase(name
) || lltype
.fMiName
.equalsIgnoreCase(name
);
102 return LogLevelType
.LOGLEVEL_NONE
;
This page took 0.047385 seconds and 5 git commands to generate.