List Contains In List Of Object Code Example

Snippet 1
  boolean found = list.stream()
              .anyMatch(p -> p.name.equals(personName)); 
Snippet 2
  public boolean containsName(final List list, final String name){
    return list.stream().map(MyObject::getName).filter(name::equals).findFirst().isPresent();
} 

Similar Snippets


Creating Java Main Method Code Example - java

Find Duplicates In Arraylist Java Code Example - java

Java Creat A Folder Code Example - java

Firestore Find Doc And Set Data Code Example - java

Create Copy Of Array From Another Array Code Example - java