Java List First Item getFirstItemOrNull(List items)

Here you can find the source of getFirstItemOrNull(List items)

Description

get First Item Or Null

License

Open Source License

Declaration

public static String getFirstItemOrNull(List<String> items) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.List;

public class Main {
    public static String getFirstItemOrNull(List<String> items) {
        return items == null || items.size() == 0 ? null : items.get(0);
    }//from  w ww  . j a  va 2 s.  c  o  m
}

Related

  1. getFirstElement(List list)
  2. getFirstElement(List list)
  3. getFirstElementFromList(List list)
  4. getFirstFromList(List list)
  5. getFirstInstanceOf(List source, String className)
  6. getFirstLeaf(List aList)
  7. getFirstNameIndex(List list)
  8. getFirstNonEmptyIndex(final List> list)
  9. getFirstObject(List valueList)

    HOME | Copyright © www.java2s.com 2016