FunctionMap

See javadoc - uk.gov.gchq.koryphe.function.FunctionMap

Available since Koryphe version 1.0.0

Applies a function to all values in a map.

Examples

Multiply all map values by 10

Java
JSON
Full JSON
Python
final FunctionMap<String, Integer, Integer> function = new FunctionMap<>(new MultiplyBy(10));
{
  "class" : "FunctionMap",
  "function" : {
    "class" : "MultiplyBy",
    "by" : 10
  }
}
{
  "class" : "uk.gov.gchq.koryphe.function.FunctionMap",
  "function" : {
    "class" : "uk.gov.gchq.koryphe.impl.function.MultiplyBy",
    "by" : 10
  }
}
g.FunctionMap( 
  function=g.MultiplyBy( 
    by=10 
  ) 
)

Input type:

java.util.Map

Example inputs:

Input TypeInputResult TypeResult
java.util.HashMap{key1=1, key2=2, key3=3}java.util.HashMap{key1=10, key2=20, key3=30}
java.util.HashMap{key1=null, key2=2, key3=3}java.util.HashMap{key1=null, key2=20, key3=30}
nullnull

results matching ""

    No results matching ""