Top Inners Fields Constructors Methods
org.hamcrest.core

public Class CombinableMatcher<T>

extends TypeSafeDiagnosingMatcher<T>
Class Inheritance
Imports
org.hamcrest.Description, .Matcher, .TypeSafeDiagnosingMatcher, java.util.ArrayList

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
public static class

Field Summary

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

Constructor Summary

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

Method Summary

Modifier and TypeMethod and Description
public CombinableMatcher<T>
and(Matcher<? super T> other)

public static <LHS> CombinableMatcher.CombinableBothMatcher<LHS>
both(Matcher<? super LHS> matcher)

Creates a matcher that matches when both of the specified matchers match the examined object.

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 <LHS> CombinableMatcher.CombinableEitherMatcher<LHS>
either(Matcher<? super LHS> matcher)

Creates a matcher that matches when either of the specified matchers match the examined object.

protected boolean
matchesSafely(T item, Description mismatch)

Implements abstract org.hamcrest.TypeSafeDiagnosingMatcher.matchesSafely.

Subclasses should implement this.
public CombinableMatcher<T>
or(Matcher<? super T> other)

private ArrayList<Matcher<? super T>>
templatedListWith(Matcher<? super T> other)

Inherited from org.hamcrest.TypeSafeDiagnosingMatcher:
describeMismatchmatches

Field Detail

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

Constructor Detail

CombinableMatcherback to summary
public CombinableMatcher(Matcher<? super T> matcher)

Method Detail

andback to summary
public CombinableMatcher<T> and(Matcher<? super T> other)
bothback to summary
public static <LHS> CombinableMatcher.CombinableBothMatcher<LHS> both(Matcher<? super LHS> matcher)

Creates a matcher that matches when both of the specified matchers match the examined object. For example:

assertThat("fab", both(containsString("a")).and(containsString("b")))
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
eitherback to summary
public static <LHS> CombinableMatcher.CombinableEitherMatcher<LHS> either(Matcher<? super LHS> matcher)

Creates a matcher that matches when either of the specified matchers match the examined object. For example:

assertThat("fan", either(containsString("a")).or(containsString("b")))
matchesSafelyback to summary
protected boolean matchesSafely(T item, Description mismatch)

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
orback to summary
public CombinableMatcher<T> or(Matcher<? super T> other)
templatedListWithback to summary
private ArrayList<Matcher<? super T>> templatedListWith(Matcher<? super T> other)
org.hamcrest.core back to summary

public final Class CombinableMatcher.CombinableBothMatcher<X>

extends Object
Class Inheritance

Field Summary

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

Constructor Summary

AccessConstructor and Description
public
CombinableBothMatcher(Matcher<? super X> matcher)

Method Summary

Modifier and TypeMethod and Description
public CombinableMatcher<X>
and(Matcher<? super X> other)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

firstback to summary
private final Matcher<? super X> first

Constructor Detail

CombinableBothMatcherback to summary
public CombinableBothMatcher(Matcher<? super X> matcher)

Method Detail

andback to summary
public CombinableMatcher<X> and(Matcher<? super X> other)
org.hamcrest.core back to summary

public final Class CombinableMatcher.CombinableEitherMatcher<X>

extends Object
Class Inheritance

Field Summary

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

Constructor Summary

AccessConstructor and Description
public
CombinableEitherMatcher(Matcher<? super X> matcher)

Method Summary

Modifier and TypeMethod and Description
public CombinableMatcher<X>
or(Matcher<? super X> other)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

firstback to summary
private final Matcher<? super X> first

Constructor Detail

CombinableEitherMatcherback to summary
public CombinableEitherMatcher(Matcher<? super X> matcher)

Method Detail

orback to summary
public CombinableMatcher<X> or(Matcher<? super X> other)