Java Utililty Methods List First Item

List of utility methods to do List First Item

Description

The list of methods to do List First Item are organized into topic(s).

Method

Tfirst(List l)
first
return l.get(0);
Tfirst(List l)
Get the first element from a list.
return l.get(0);
Tfirst(List list)
first
return isNullOrEmpty(list) ? null : list.get(0);
Tfirst(List list)
first
return first(list, null);
Tfirst(List list)
first
return isEmpty(list) ? null : list.get(0);
Tfirst(List list)
Returns the first element of the passed list, null if the list is empty or null.
return isNotEmpty(list) ? list.get(0) : null;
Tfirst(List list)
first
if (list == null || list.isEmpty())
    throw new IllegalArgumentException("List is empty");
return list.get(0);
Tfirst(List list)
first
return get(list, 0);
Tfirst(List list)
first
if (list.size() < 1) {
    throw new NoSuchElementException("Collection does not have a enough elements");
return list.get(0);
Tfirst(List list)
first
if (list.isEmpty()) {
    return null;
return list.get(0);