LastItem

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

Available since Koryphe version 1.1.0

For a given Iterable, a LastItem will extract the last item.

Examples

Extract last item

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

Input type:

java.lang.Iterable

Example inputs:

Input TypeInputResult TypeResult
java.util.ArrayList[1, 2, 3]java.lang.Integer3
java.util.ArrayList[5, 8, 13]java.lang.Integer13
java.util.ArrayList[21, 34, 55]java.lang.Integer55
java.util.ArrayList[1, null, 3]java.lang.Integer3
java.util.ArrayList[1, 2, null]null
nullIllegalArgumentException: Input cannot be null

results matching ""

    No results matching ""