Java List Contain containsBasedOnEntryIdentity(final List list, final Object object)

Here you can find the source of containsBasedOnEntryIdentity(final List list, final Object object)

Description

contains Based On Entry Identity

License

Open Source License

Declaration

public static boolean containsBasedOnEntryIdentity(final List<?> list, final Object object) 

Method Source Code

//package com.java2s;
/******************************************************************************
 * Copyright (c) 2015 Oracle and Liferay
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors://from  www  .ja  v a 2  s .c  o m
 *    Konstantin Komissarchik - initial implementation and ongoing maintenance
 *    Gregory Amerson - [358295] Need access to selection in list property editor
 ******************************************************************************/

import java.util.List;

public class Main {
    public static boolean containsBasedOnEntryIdentity(final List<?> list, final Object object) {
        for (Object obj : list) {
            if (obj == object) {
                return true;
            }
        }

        return false;
    }
}

Related

  1. containsAny(Set theList, Set toSearch)
  2. containsAnyOf(Exception e, List nonRetryableKeywords)
  3. containsArgument(List argList, Option option)
  4. containsAtLeastAValue(List values)
  5. containsAtLeastOneElement(List l1, List l2)
  6. containsCaseInsensitive(String s, List l)
  7. containsColumnByAlias(List columns, String alias)
  8. containsDuplicates(List list, Comparator comparator)
  9. containsElement( List> list, List element)