Java List First Item first(List list)

Here you can find the source of first(List list)

Description

first

License

Apache License

Declaration

public static <T> T first(List<T> list) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.util.Collection;

import java.util.List;

public class Main {
    public static <T> T first(List<T> list) {
        return isNullOrEmpty(list) ? null : list.get(0);
    }/*  www  .j a  v  a 2  s.  com*/

    public static boolean isNullOrEmpty(Collection<?> collection) {
        return collection == null || collection.isEmpty();
    }
}

Related

  1. first(List list)
  2. first(List list)
  3. first(List list)
  4. first(List list)
  5. first(List list)
  6. first_nItems(int n, Collection fromList)
  7. firstBoolean(List list)
  8. firstColumnRemovable(List data)
  9. firstElement(List list)