Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

java list of a class has a string that is equal to

public boolean containsName(final List<MyObject> list, final String name){
    return list.stream().map(MyObject::getName).filter(name::equals).findFirst().isPresent();
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #java #list #class #string #equal
ADD COMMENT
Topic
Name
3+6 =