Java List Contain isContain(List list, Integer i)

Here you can find the source of isContain(List list, Integer i)

Description

is Contain

License

Apache License

Declaration

public static boolean isContain(List<Integer> list, Integer i) 

Method Source Code

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

import java.util.Collection;
import java.util.Collections;

import java.util.List;

public class Main {
    public static boolean isContain(List<Integer> list, Integer i) {
        return !isCollectionEmpty(list) && i != null && Collections.binarySearch(list, i) >= 0;
    }//w  w w  .j  a  v a 2  s.  c o m

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

Related

  1. containsWhitespace(List elements)
  2. firstFunnyString(List words, String containedTest)
  3. getListValue(Object container, int index)
  4. identityContains(Object o, List list)
  5. indexOfLineContaining(List lines, String s)
  6. isContainedInAll(String keyToSearch, List> list)
  7. isContains(final Object value, final Object... list)
  8. isContains(List roles, String role, String module)
  9. isEitherContains(List one, List two)