Commit | Line | Data |
---|---|---|
73fb6785 AM |
1 | /* |
2 | * Copyright (C) 2016, EfficiOS Inc., Alexandre Montplaisir <alexmonthy@efficios.com> | |
3 | * | |
4 | * This program is free software; you can redistribute it and/or modify | |
5 | * it under the terms of the GNU General Public License as published by | |
6 | * the Free Software Foundation; either version 2 of the License, or | |
7 | * (at your option) any later version. | |
8 | * | |
9 | * This program is distributed in the hope that it will be useful, | |
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 | * GNU General Public License for more details. | |
13 | * | |
14 | * You should have received a copy of the GNU General Public License along | |
15 | * with this program; if not, write to the Free Software Foundation, Inc., | |
16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | |
17 | */ | |
18 | ||
19 | package org.lttng.ust.agent.integration.context; | |
20 | ||
21 | import org.lttng.ust.agent.context.IContextInfoRetriever; | |
22 | ||
23 | interface ContextInfoRetrieverStubs { | |
24 | ||
5ab95f21 | 25 | String CONTEXT_NAME = "some.context_name"; |
73fb6785 AM |
26 | |
27 | Integer INTEGER_VALUE = Integer.valueOf(42); | |
28 | Long LONG_VALUE = Long.valueOf(9001); | |
29 | Double DOUBLE_VALUE = Double.valueOf(11.55); | |
30 | Character CHARACTER_VALUE = Character.valueOf('a'); | |
31 | Float FLOAT_VALUE = Float.valueOf(2.8f); | |
32 | Byte BYTE_VALUE = Byte.valueOf((byte) 8); | |
33 | Short SHORT_VALUE = Short.valueOf((short) 500); | |
34 | String STRING_VALUE = "ContextValue"; | |
35 | ||
36 | String OBJECT_VALUE_STRING = "ValueToString"; | |
37 | Object OBJECT_VALUE = new Object() { | |
38 | @Override | |
39 | public String toString() { | |
40 | return OBJECT_VALUE_STRING; | |
41 | } | |
42 | }; | |
43 | ||
44 | ||
45 | IContextInfoRetriever NULL_RETRIEVER = (key -> null); | |
46 | IContextInfoRetriever INTEGER_RETRIEVER = (key -> (CONTEXT_NAME.equals(key) ? INTEGER_VALUE : null)); | |
47 | IContextInfoRetriever LONG_RETRIEVER = (key -> (CONTEXT_NAME.equals(key) ? LONG_VALUE : null)); | |
48 | IContextInfoRetriever DOUBLE_RETRIEVER = (key -> (CONTEXT_NAME.equals(key) ? DOUBLE_VALUE : null)); | |
49 | IContextInfoRetriever CHARACTER_RETRIEVER = (key -> (CONTEXT_NAME.equals(key) ? CHARACTER_VALUE : null)); | |
50 | IContextInfoRetriever FLOAT_RETRIEVER = (key -> (CONTEXT_NAME.equals(key) ? FLOAT_VALUE : null)); | |
51 | IContextInfoRetriever BYTE_RETRIEVER = (key -> (CONTEXT_NAME.equals(key) ? BYTE_VALUE : null)); | |
52 | IContextInfoRetriever SHORT_RETRIEVER = (key -> (CONTEXT_NAME.equals(key) ? SHORT_VALUE : null)); | |
53 | IContextInfoRetriever BOOLEAN_TRUE_RETRIEVER = (key -> (CONTEXT_NAME.equals(key) ? Boolean.TRUE : null)); | |
54 | IContextInfoRetriever BOOLEAN_FALSE_RETRIEVER = (key -> (CONTEXT_NAME.equals(key) ? Boolean.FALSE : null)); | |
55 | IContextInfoRetriever STRING_RETRIEVER = (key -> (CONTEXT_NAME.equals(key) ? STRING_VALUE : null)); | |
56 | IContextInfoRetriever OBJECT_RETRIEVER = (key -> (CONTEXT_NAME.equals(key) ? OBJECT_VALUE : null)); | |
57 | ||
58 | } |