Commit | Line | Data |
---|---|---|
d4a8d935 | 1 | /******************************************************************************* |
11252342 | 2 | * Copyright (c) 2012, 2013 Ericsson |
d4a8d935 BH |
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 | * Bernd Hufmann - Initial API and implementation | |
11 | *******************************************************************************/ | |
12 | ||
2bdf0193 | 13 | package org.eclipse.tracecompass.tmf.ctf.core; |
d4a8d935 | 14 | |
2bdf0193 | 15 | import org.eclipse.tracecompass.tmf.core.util.Pair; |
d4a8d935 BH |
16 | |
17 | /** | |
18 | * Pair of Enum value name and its long value. | |
19 | * | |
20 | * @author Bernd Hufmann | |
21 | * @since 2.0 | |
22 | */ | |
23 | public class CtfEnumPair extends Pair<String, Long> { | |
24 | ||
25 | /** | |
26 | * Constructs a CtfEnumPair | |
27 | * | |
28 | * @param strValue | |
29 | * The first parameter of the pair (String) | |
30 | * @param longValue | |
31 | * The second parameter of the pair (Long) | |
32 | */ | |
33 | public CtfEnumPair(String strValue, Long longValue) { | |
34 | super(strValue, longValue); | |
35 | } | |
36 | ||
37 | /** | |
38 | * Returns the String value of the Enum. | |
39 | * | |
40 | * @return the string value | |
41 | */ | |
42 | public String getStringValue() { | |
43 | return getFirst(); | |
44 | } | |
45 | ||
46 | /** | |
47 | * Returns the long value of the Enum. | |
48 | * | |
49 | * @return the Long value | |
50 | */ | |
51 | public Long getLongValue() { | |
52 | return getSecond(); | |
53 | } | |
54 | ||
d4a8d935 BH |
55 | @Override |
56 | public String toString() { | |
57 | return getFirst(); | |
58 | } | |
59 | } |