LongStream noneMatch(LongPredicate predicate) example

Description

LongStream noneMatch(LongPredicate predicate) returns whether no elements of this stream match the provided predicate.

Syntax

noneMatch has the following syntax.


boolean noneMatch(LongPredicate predicate)

Example

The following example shows how to use noneMatch.


import java.util.stream.LongStream;
//from w ww  . j a  va2 s.c o m
public class Main {
  public static void main(String[] args) {
    LongStream b = LongStream.of(1L, 2L, Long.MAX_VALUE, Long.MIN_VALUE);
    boolean o = b.noneMatch(n-> n > 10);
    
    System.out.println(o); 
  }
}

The code above generates the following result.





















Home »
  Java Streams »
    Reference »




Collectors
DoubleStream
DoubleStream.Builder
IntStream
IntStream.Builder
LongStream
LongStream.Builder
Stream
Stream.Builder