blob: 84d97b71f60c7f00565bf50dcae42aff0d340258 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.prelude.templates;
import java.util.Collection;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
/**
* A context having a map as secondary storage
* @deprecated use a Renderer instead
*/
@SuppressWarnings("deprecation")
@Deprecated // TODO: Remove on Vespa 7
public class MapContext extends Context {
private Map<String, Object> map = new LinkedHashMap<>();
@Override
public Object get(String key) {
return normalizeValue(map.get(key));
}
public Object put(String name, Object value) {
return map.put(name, value);
}
public Object remove(Object name) {
return map.remove(name);
}
@Override
public Collection<? extends Object> getKeys() {
return map.keySet();
}
}
|