Java List Contain containsAny(List value, Object[] values)

Here you can find the source of containsAny(List value, Object[] values)

Description

contains Any

License

Apache License

Declaration

public static boolean containsAny(List<?> value, Object[] values) 

Method Source Code

//package com.java2s;
/*// w  w  w .  j a  va  2s .c o m
 * Copyright 2011-2013 HTTL Team.
 *  
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *  
 *      http://www.apache.org/licenses/LICENSE-2.0
 *  
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

import java.util.*;

public class Main {
    public static boolean containsAny(List<?> value, Object[] values) {
        if (value != null && values != null) {
            for (Object v : values) {
                if (value.contains(v)) {
                    return true;
                }
            }
        }
        return false;
    }
}

Related

  1. contains1(final String id, final List idList)
  2. containsAFloatingPointNumber(List values)
  3. containsAll(List list, T... items)
  4. containsAllIgnoreCase(List left, List right)
  5. containsAny(final String projectName, final List indicators)
  6. containsAny(Set theList, Set toSearch)
  7. containsAnyOf(Exception e, List nonRetryableKeywords)
  8. containsArgument(List argList, Option option)
  9. containsAtLeastAValue(List values)