Top Fields Constructors Methods
org.hamcrest.core

public Class Every<T>

extends TypeSafeDiagnosingMatcher<Iterable<? extends T>>
Class Inheritance
Imports
org.hamcrest.Description, .Matcher, .TypeSafeDiagnosingMatcher

Field Summary

Modifier and TypeField and Description
private final Matcher<? super T>

Constructor Summary

AccessConstructor and Description
public
Every(Matcher<? super T> matcher)

Method Summary

Modifier and TypeMethod and Description
public void
describeTo(Description
The description to be built or appended to.
description
)

Implements org.hamcrest.SelfDescribing.describeTo.

Generates a description of the object.
public static <U> Matcher<Iterable<? extends U>>
everyItem(final Matcher<U>
the matcher to apply to every item provided by the examined Iterable
itemMatcher
)

Creates a matcher for Iterables that only matches when a single pass over the examined Iterable yields items that are all matched by the specified itemMatcher.

public boolean
matchesSafely(Iterable<? extends T> collection, Description mismatchDescription)

Implements abstract org.hamcrest.TypeSafeDiagnosingMatcher.matchesSafely.

Subclasses should implement this.
Inherited from org.hamcrest.TypeSafeDiagnosingMatcher:
describeMismatchmatches

Field Detail

matcherback to summary
private final Matcher<? super T> matcher

Constructor Detail

Everyback to summary
public Every(Matcher<? super T> matcher)

Method Detail

describeToback to summary
public void describeTo(Description description)

Implements org.hamcrest.SelfDescribing.describeTo.

Doc from org.hamcrest.SelfDescribing.describeTo.

Generates a description of the object. The description may be part of a a description of a larger object of which this is just a component, so it should be worded appropriately.

Parameters
description:Description

The description to be built or appended to.

Annotations
@Override
everyItemback to summary
public static <U> Matcher<Iterable<? extends U>> everyItem(final Matcher<U> itemMatcher)

Creates a matcher for Iterables that only matches when a single pass over the examined Iterable yields items that are all matched by the specified itemMatcher. For example:

assertThat(Arrays.asList("bar", "baz"), everyItem(startsWith("ba")))
Parameters
itemMatcher:Matcher<U>

the matcher to apply to every item provided by the examined Iterable

matchesSafelyback to summary
public boolean matchesSafely(Iterable<? extends T> collection, Description mismatchDescription)

Implements abstract org.hamcrest.TypeSafeDiagnosingMatcher.matchesSafely.

Doc from org.hamcrest.TypeSafeDiagnosingMatcher.matchesSafely.

Subclasses should implement this. The item will already have been checked for the specific type and will never be null.

Annotations
@Override