Top Description Fields Constructors Methods
org.hamcrest.core

public Class IsAnything<T>

extends BaseMatcher<T>
Class Inheritance
Imports
org.hamcrest.BaseMatcher, .Description, .Matcher

A matcher that always returns true.

Field Summary

Modifier and TypeField and Description
private final String

Constructor Summary

AccessConstructor and Description
public
public
IsAnything(String message)

Method Summary

Modifier and TypeMethod and Description
public static Matcher<Object>
anything()

Creates a matcher that always matches, regardless of the examined object.

public static Matcher<Object>
anything(String
a meaningful String used when describing itself
description
)

Creates a matcher that always matches, regardless of the examined object, but describes itself with the specified String.

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
matches(Object
the object against which the matcher is evaluated.
o
)

Implements org.hamcrest.Matcher.matches.

Evaluates the matcher for argument item.
Inherited from org.hamcrest.BaseMatcher:
_dont_implement_Matcher___instead_extend_BaseMatcher_describeMismatchisNotNulltoString

Field Detail

messageback to summary
private final String message

Constructor Detail

IsAnythingback to summary
public IsAnything()
IsAnythingback to summary
public IsAnything(String message)

Method Detail

anythingback to summary
public static Matcher<Object> anything()

Creates a matcher that always matches, regardless of the examined object.

anythingback to summary
public static Matcher<Object> anything(String description)

Creates a matcher that always matches, regardless of the examined object, but describes itself with the specified String.

Parameters
description:String

a meaningful String used when describing itself

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)

Implements org.hamcrest.Matcher.matches.

Doc from org.hamcrest.Matcher.matches.

Evaluates the matcher for argument item. This method matches against Object, instead of the generic type T. This is because the caller of the Matcher does not know at runtime what the type is (because of type erasure with Java generics). It is down to the implementations to check the correct type.

Parameters
o:Object

the object against which the matcher is evaluated.

Returns:boolean

true if item matches, otherwise false.

Annotations
@Override