Java List Equal equalsAny(String toMatch, List matchesAny)

Here you can find the source of equalsAny(String toMatch, List matchesAny)

Description

equals Any

License

Apache License

Parameter

Parameter Description
toMatch a parameter
matchesAny a parameter

Declaration

public static boolean equalsAny(String toMatch, List<String> matchesAny) 

Method Source Code


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

import java.util.Arrays;
import java.util.List;

public class Main {
    /**/*  www . java  2 s.c om*/
     * 
     * @param toMatch
     * @param matchesAny
     * @return
     */
    public static boolean equalsAny(String toMatch, List<String> matchesAny) {
        return matchesAny != null && matchesAny.contains(toMatch);
    }

    /**
     * 
     * @param toMatch
     * @param matchesAny
     * @return
     */
    public static boolean equalsAny(String toMatch, String... matchesAny) {
        return equalsAny(toMatch, Arrays.asList(matchesAny));
    }
}

Related

  1. equals(List l1, List l2, boolean ignoreCase)
  2. equals(List list1, List list2)
  3. equals(List lhs, List rhs)
  4. equals(List lhs, List rhs, Comparator comparator)
  5. equals(List list1, List list2)
  6. equalsBasedOnEntryIdentity(final List a, final List b)
  7. equalShallow(List list0, List list1)
  8. isEqual(Collection listA, Collection listB)
  9. isEqual(List list1, List list2)