Java List Contain identityContains(Object o, List list)

Here you can find the source of identityContains(Object o, List list)

Description

Check if o is in list with == operator

License

Open Source License

Declaration

public static boolean identityContains(Object o, List<?> list) 

Method Source Code

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

import java.util.List;

public class Main {
    /**//from w w  w . ja v  a 2s .  com
     * Check if o is in list with == operator
     */
    public static boolean identityContains(Object o, List<?> list) {
        for (Object l : list) {
            if (o == l)
                return true;
        }
        return false;
    }
}

Related

  1. containsUnorderedSequence(List a, List b)
  2. containsUsingToArray(List list, Integer value)
  3. containsWhitespace(List elements)
  4. firstFunnyString(List words, String containedTest)
  5. getListValue(Object container, int index)
  6. indexOfLineContaining(List lines, String s)
  7. isContain(List list, Integer i)
  8. isContainedInAll(String keyToSearch, List> list)
  9. isContains(final Object value, final Object... list)