public class ListFunctionalSupport extends Object
Constructor and Description |
---|
ListFunctionalSupport() |
Modifier and Type | Method and Description |
---|---|
static <T> List<T> |
drop(List<T> list,
int count)
Drop the first N elements and create a new list.
|
static <T> T |
first(List<T> list)
Get the first element in list.
|
static <T> T |
last(List<T> list)
get the last element in list.
|
static <T> List<T> |
rest(List<T> list)
Drop the only first element and create a new list.
|
static <T> List<T> |
takeLast(List<T> list,
int count)
Get the last N elements as a new list.
|
public static <T> T first(List<T> list)
list
- list to getpublic static <T> T last(List<T> list)
list
- list to getpublic static <T> List<T> takeLast(List<T> list, int count)
list
- list to getcount
- element count to getpublic static <T> List<T> drop(List<T> list, int count)
list
- the listcount
- element count to droppublic static <T> List<T> rest(List<T> list)
list
- the listListFunctionalSupport#drop(List, int)}
Copyright © 2023 The Apache Software Foundation. All rights reserved.