Top Description Fields Constructors Methods
org.hamcrest.core

public Class AllOf<T>

extends DiagnosingMatcher<T>
Class Inheritance
Imports
org.hamcrest.Description, .DiagnosingMatcher, .Factory, .Matcher, java.util.ArrayList, .Arrays, .List

Calculates the logical conjunction of multiple matchers. Evaluation is shortcut, so subsequent matchers are not called if an earlier matcher returns false.

Field Summary

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

Constructor Summary

AccessConstructor and Description
public
AllOf(Iterable<Matcher<? super T>> matchers)

Method Summary

Modifier and TypeMethod and Description
public static <T> Matcher<T>
allOf(Iterable<Matcher<? super T>> matchers)

Creates a matcher that matches if the examined object matches ALL of the specified matchers.

public static <T> Matcher<T>
allOf(Matcher<? super T>... matchers)

Creates a matcher that matches if the examined object matches ALL of the specified matchers.

public static <T> Matcher<T>
allOf(Matcher<? super T> first, Matcher<? super T> second)

Creates a matcher that matches if the examined object matches ALL of the specified matchers.

public static <T> Matcher<T>
allOf(Matcher<? super T> first, Matcher<? super T> second, Matcher<? super T> third)

Creates a matcher that matches if the examined object matches ALL of the specified matchers.

public static <T> Matcher<T>
allOf(Matcher<? super T> first, Matcher<? super T> second, Matcher<? super T> third, Matcher<? super T> fourth)

Creates a matcher that matches if the examined object matches ALL of the specified matchers.

public static <T> Matcher<T>
allOf(Matcher<? super T> first, Matcher<? super T> second, Matcher<? super T> third, Matcher<? super T> fourth, Matcher<? super T> fifth)

Creates a matcher that matches if the examined object matches ALL of the specified matchers.

public static <T> Matcher<T>
allOf(Matcher<? super T> first, Matcher<? super T> second, Matcher<? super T> third, Matcher<? super T> fourth, Matcher<? super T> fifth, Matcher<? super T> sixth)

Creates a matcher that matches if the examined object matches ALL of the specified matchers.

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 boolean
Inherited from org.hamcrest.DiagnosingMatcher:
describeMismatchmatches

Field Detail

matchersback to summary
private final Iterable<Matcher<? super T>> matchers

Constructor Detail

AllOfback to summary
public AllOf(Iterable<Matcher<? super T>> matchers)

Method Detail

allOfback to summary
public static <T> Matcher<T> allOf(Iterable<Matcher<? super T>> matchers)

Creates a matcher that matches if the examined object matches ALL of the specified matchers.

For example:

assertThat("myValue", allOf(startsWith("my"), containsString("Val")))
Annotations
@Factory
allOfback to summary
public static <T> Matcher<T> allOf(Matcher<? super T>... matchers)

Creates a matcher that matches if the examined object matches ALL of the specified matchers.

For example:

assertThat("myValue", allOf(startsWith("my"), containsString("Val")))
Annotations
@Factory
allOfback to summary
public static <T> Matcher<T> allOf(Matcher<? super T> first, Matcher<? super T> second)

Creates a matcher that matches if the examined object matches ALL of the specified matchers.

For example:

assertThat("myValue", allOf(startsWith("my"), containsString("Val")))
Annotations
@Factory
allOfback to summary
public static <T> Matcher<T> allOf(Matcher<? super T> first, Matcher<? super T> second, Matcher<? super T> third)

Creates a matcher that matches if the examined object matches ALL of the specified matchers.

For example:

assertThat("myValue", allOf(startsWith("my"), containsString("Val")))
Annotations
@Factory
allOfback to summary
public static <T> Matcher<T> allOf(Matcher<? super T> first, Matcher<? super T> second, Matcher<? super T> third, Matcher<? super T> fourth)

Creates a matcher that matches if the examined object matches ALL of the specified matchers.

For example:

assertThat("myValue", allOf(startsWith("my"), containsString("Val")))
Annotations
@Factory
allOfback to summary
public static <T> Matcher<T> allOf(Matcher<? super T> first, Matcher<? super T> second, Matcher<? super T> third, Matcher<? super T> fourth, Matcher<? super T> fifth)

Creates a matcher that matches if the examined object matches ALL of the specified matchers.

For example:

assertThat("myValue", allOf(startsWith("my"), containsString("Val")))
Annotations
@Factory
allOfback to summary
public static <T> Matcher<T> allOf(Matcher<? super T> first, Matcher<? super T> second, Matcher<? super T> third, Matcher<? super T> fourth, Matcher<? super T> fifth, Matcher<? super T> sixth)

Creates a matcher that matches if the examined object matches ALL of the specified matchers.

For example:

assertThat("myValue", allOf(startsWith("my"), containsString("Val")))
Annotations
@Factory
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
matchesback to summary
public boolean matches(Object o, Description mismatch)

Implements abstract org.hamcrest.DiagnosingMatcher.matches.

Annotations
@Override