Java List Contain containsExactly(List items, T... itemsToMatch)

Here you can find the source of containsExactly(List items, T... itemsToMatch)

Description

contains Exactly

License

Open Source License

Declaration

public static <T> boolean containsExactly(List<T> items, T... itemsToMatch) 

Method Source Code


//package com.java2s;

import java.util.List;

public class Main {
    public static <T> boolean containsExactly(List<T> items, T... itemsToMatch) {
        if (items.size() != itemsToMatch.length) {
            return false;
        }//from  w ww .  jav  a  2  s .c o  m

        for (int i = 0; i < items.size(); i++) {
            if (!items.get(i).equals(itemsToMatch[i])) {
                return false;
            }
        }
        return true;
    }
}

Related

  1. containsColumnByAlias(List columns, String alias)
  2. containsDuplicates(List list, Comparator comparator)
  3. containsElement( List> list, List element)
  4. containsEnchantment(String enchantments, List enchList)
  5. containsExactly(Collection list, T... mustHaveItems)
  6. containsExternalFilter(List filterList, String dataSetExtId, String dataSourceExtId)
  7. containsFileName(String fileName, List filterList)
  8. containsHelpRequest(List args)
  9. containsId(List aList, Object anObj)