Class StreamMatchers

    • Constructor Summary

      Constructors 
      Constructor Description
      StreamMatchers()  
    • Method Summary

      All Methods Static Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      static <T> org.hamcrest.Matcher<Stream<T>> allMatch​(org.hamcrest.Matcher<T> matcher)
      A matcher for a finite Stream of objects, all of which must match the given Matcher.
      static org.hamcrest.Matcher<DoubleStream> allMatchDouble​(org.hamcrest.Matcher<Double> matcher)
      A matcher for a finite Stream of primitive doubles, all of which must match the given Matcher.
      static org.hamcrest.Matcher<IntStream> allMatchInt​(org.hamcrest.Matcher<Integer> matcher)
      A matcher for a finite Stream of primitive ints, all of which must match the given Matcher.
      static org.hamcrest.Matcher<LongStream> allMatchLong​(org.hamcrest.Matcher<Long> matcher)
      A matcher for a finite Stream of primitive longs, all of which must match the given Matcher.
      static <T> org.hamcrest.Matcher<Stream<T>> anyMatch​(org.hamcrest.Matcher<T> matcher)
      A matcher for a finite Stream of objects, at least one of which must match the given Matcher.
      static org.hamcrest.Matcher<DoubleStream> anyMatchDouble​(org.hamcrest.Matcher<Double> matcher)
      A matcher for a finite Stream of primitive doubles, at least one of which must match the given Matcher.
      static org.hamcrest.Matcher<IntStream> anyMatchInt​(org.hamcrest.Matcher<Integer> matcher)
      A matcher for a finite Stream of primitive ints, at least one of which must match the given Matcher.
      static org.hamcrest.Matcher<LongStream> anyMatchLong​(org.hamcrest.Matcher<Long> matcher)
      A matcher for a finite Stream of primitive longs, at least one of which must match the given Matcher.
      static <T,​S extends BaseStream<T,​? extends S>>
      org.hamcrest.Matcher<S>
      contains​(org.hamcrest.Matcher<T>... expectedMatchers)
      Deprecated.
      name clashes with Matchers.contains(Matcher...), use yieldsExactly(Matcher...) instead
      static <T,​S extends BaseStream<T,​? extends S>>
      org.hamcrest.Matcher<S>
      contains​(T... expected)
      Deprecated.
      name clashes with Matchers.contains(Object...), use yieldsExactly(Object...) instead
      static <T,​S extends BaseStream<T,​? extends S>>
      org.hamcrest.Matcher<S>
      empty()
      Deprecated.
      name clashes with Matchers.empty(), use yieldsNothing() instead
      static <T,​S extends BaseStream<T,​? extends S>>
      org.hamcrest.Matcher<S>
      equalTo​(S expected)
      Deprecated.
      name clashes with Matchers.equalTo(Object), use yieldsSameAs(BaseStream) instead
      static org.hamcrest.Matcher<DoubleStream> startsWith​(DoubleStream expected, long limit)
      A matcher for potentially infinite Streams of primitive doubles where the first limit items from each must be equal
      static org.hamcrest.Matcher<IntStream> startsWith​(IntStream expected, long limit)
      A matcher for potentially infinite Streams of primitive ints where the first limit items from each must be equal
      static org.hamcrest.Matcher<LongStream> startsWith​(LongStream expected, long limit)
      A matcher for potentially infinite Streams of primitive ints where the first limit items from each must be equal
      static <T> org.hamcrest.Matcher<Stream<T>> startsWith​(Stream<T> expected, long limit)
      A matcher for potentially infinite Streams of objects where the first limit items from each must be equal
      static <T> org.hamcrest.Matcher<Stream<T>> startsWith​(T... expected)
      A matcher for a potentially infinite Stream of objects against n expected items, matching if the first n items produced by the Stream equal the expected items in order.
      static <T> org.hamcrest.Matcher<Stream<T>> startsWithAll​(org.hamcrest.Matcher<T> matcher, long limit)
      A matcher for potentially infinite Streams of objects, the first limit of which must match the given Matcher
      static org.hamcrest.Matcher<DoubleStream> startsWithAllDouble​(org.hamcrest.Matcher<Double> matcher, long limit)
      A matcher for potentially infinite Streams of primitive doubles, the first limit of which must match the given Matcher
      static org.hamcrest.Matcher<IntStream> startsWithAllInt​(org.hamcrest.Matcher<Integer> matcher, long limit)
      A matcher for potentially infinite Streams of primitive ints, the first limit of which must match the given Matcher
      static org.hamcrest.Matcher<LongStream> startsWithAllLong​(org.hamcrest.Matcher<Long> matcher, long limit)
      A matcher for potentially infinite Streams of primitive longs, the first limit of which must match the given Matcher
      static <T> org.hamcrest.Matcher<Stream<T>> startsWithAny​(org.hamcrest.Matcher<T> matcher, long limit)
      A matcher for potentially infinite Streams of objects, at least one of the first limit of which must match the given Matcher
      static org.hamcrest.Matcher<DoubleStream> startsWithAnyDouble​(org.hamcrest.Matcher<Double> matcher, long limit)
      A matcher for potentially infinite Streams of primitive doubles, at least one of the first limit of which must match the given Matcher
      static org.hamcrest.Matcher<IntStream> startsWithAnyInt​(org.hamcrest.Matcher<Integer> matcher, long limit)
      A matcher for potentially infinite Streams of primitive ints, at least one of the first limit of which must match the given Matcher
      static org.hamcrest.Matcher<LongStream> startsWithAnyLong​(org.hamcrest.Matcher<Long> matcher, long limit)
      A matcher for potentially infinite Streams of primitive longs, at least one of the first limit of which must match the given Matcher
      static org.hamcrest.Matcher<DoubleStream> startsWithDouble​(double... expected)
      A matcher for a potentially infinite Stream of primitive doubles against n expected items, matching if the first n items produced by the Stream equal the expected items in order.
      static org.hamcrest.Matcher<IntStream> startsWithInt​(int... expected)
      A matcher for a potentially infinite Stream of primitive ints against n expected items, matching if the first n items produced by the Stream equal the expected items in order.
      static org.hamcrest.Matcher<LongStream> startsWithLong​(long... expected)
      A matcher for a potentially infinite Stream of primitive longs against n expected items, matching if the first n items produced by the Stream equal the expected items in order.
      static <T,​S extends BaseStream<T,​? extends S>>
      org.hamcrest.Matcher<S>
      yieldsExactly​(org.hamcrest.Matcher<T>... expectedMatchers)
      The BaseStream must produce exactly the given expected items in order, and no more.
      static <T,​S extends BaseStream<T,​? extends S>>
      org.hamcrest.Matcher<S>
      yieldsExactly​(T... expected)
      The BaseStream must produce exactly the given expected items in order, and no more.
      static <T,​S extends BaseStream<T,​? extends S>>
      org.hamcrest.Matcher<S>
      yieldsNothing()
      Matcher for a stream which yields no elements.
      static <T,​S extends BaseStream<T,​? extends S>>
      org.hamcrest.Matcher<S>
      yieldsSameAs​(S expected)
      A matcher for a finite Stream producing the same number of items as the expected Stream, and producing equal items as expected in the same order.