Java List Contain containsInstance(final List list, final Class clazz)

Here you can find the source of containsInstance(final List list, final Class clazz)

Description

contains Instance

License

Open Source License

Declaration

public static <E> boolean containsInstance(final List<E> list, final Class<? extends E> clazz) 

Method Source Code

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

import java.util.List;

public class Main {
    public static <E> boolean containsInstance(final List<E> list, final Class<? extends E> clazz) {
        return list.stream().anyMatch(e -> clazz.isInstance(e));
    }//from  w w  w . j a  va 2  s . c  o  m
}

Related

  1. containsInAnyOrder(final List test, final List control)
  2. containsIndex(int index, List objects)
  3. containsInEach(List first, List second)
  4. ContainsInList(String list, String value)
  5. containsInOrder(List a, List b)
  6. containsInstance(List list, Object object)
  7. containsItems(List smallerList, List largerList)
  8. containsNonPositives(List vals)
  9. containsNull(List list)