Search in sources :

Example 1 with FunctionMap

use of uk.gov.gchq.koryphe.function.FunctionMap in project gaffer-doc by gchq.

the class FunctionMapExample method multiplyAllMapValuesBy10.

public void multiplyAllMapValuesBy10() {
    // ---------------------------------------------------------
    final FunctionMap<String, Integer, Integer> function = new FunctionMap<>(new MultiplyBy(10));
    // ---------------------------------------------------------
    final Map<String, Integer> map1 = new HashMap<>();
    map1.put("key1", 1);
    map1.put("key2", 2);
    map1.put("key3", 3);
    final Map<String, Integer> map2 = new HashMap<>();
    map2.put("key1", null);
    map2.put("key2", 2);
    map2.put("key3", 3);
    runExample(function, null, map1, map2, null);
}
Also used : FunctionMap(uk.gov.gchq.koryphe.function.FunctionMap) MultiplyBy(uk.gov.gchq.koryphe.impl.function.MultiplyBy) HashMap(java.util.HashMap)

Aggregations

HashMap (java.util.HashMap)1 FunctionMap (uk.gov.gchq.koryphe.function.FunctionMap)1 MultiplyBy (uk.gov.gchq.koryphe.impl.function.MultiplyBy)1