FirstItem

See javadoc - uk.gov.gchq.koryphe.impl.function.FirstItem

Available since Koryphe version 1.1.0

For a given Iterable, a FirstItem will extract the first item.

Examples

Extract first item

Java
JSON
Full JSON
Python
final FirstItem<Integer> function = new FirstItem<>();
{
  "class" : "FirstItem"
}
{
  "class" : "uk.gov.gchq.koryphe.impl.function.FirstItem"
}
g.FirstItem()

Input type:

java.lang.Iterable

Example inputs:

Input TypeInputResult TypeResult
java.util.ArrayList[2, 3, 5]java.lang.Integer2
java.util.ArrayList[7, 11, 13]java.lang.Integer7
java.util.ArrayList[17, 19, null]java.lang.Integer17
java.util.ArrayList[null, 19, 27]null
nullIllegalArgumentException: Input cannot be null

results matching ""

    No results matching ""