Top Inners Fields Constructors Methods
org.hamcrest.object

public Class HasEqualValues<T>

extends TypeSafeDiagnosingMatcher<T>
Class Inheritance
Imports
org.hamcrest.Description, .DiagnosingMatcher, .Matcher, .TypeSafeDiagnosingMatcher, org.hamcrest.core.IsEqual, java.lang.reflect.Field, java.util.ArrayList, .List

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private final T
private final List<HasEqualValues.FieldMatcher>

Constructor Summary

AccessConstructor and Description
public
HasEqualValues(T expectedObject)

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.
private static List<HasEqualValues.FieldMatcher>
fieldMatchers(Object expectedObject)

protected boolean
matchesSafely(T item, Description mismatch)

Implements abstract org.hamcrest.TypeSafeDiagnosingMatcher.matchesSafely.

Subclasses should implement this.
private static Object
uncheckedGet(Field field, Object object)

Inherited from org.hamcrest.TypeSafeDiagnosingMatcher:
describeMismatchmatches

Field Detail

expectedObjectback to summary
private final T expectedObject
fieldMatchersback to summary
private final List<HasEqualValues.FieldMatcher> fieldMatchers

Constructor Detail

HasEqualValuesback to summary
public HasEqualValues(T expectedObject)

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
fieldMatchersback to summary
private static List<HasEqualValues.FieldMatcher> fieldMatchers(Object expectedObject)
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
uncheckedGetback to summary
private static Object uncheckedGet(Field field, Object object)
org.hamcrest.object back to summary

private Class HasEqualValues.FieldMatcher

extends DiagnosingMatcher<Object>
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final Field
private final Matcher<Object>

Constructor Summary

AccessConstructor and Description
public
FieldMatcher(Field field, Object expectedObject)

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

Field Detail

fieldback to summary
private final Field field
matcherback to summary
private final Matcher<Object> matcher

Constructor Detail

FieldMatcherback to summary
public FieldMatcher(Field field, Object expectedObject)

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
matchesback to summary
protected boolean matches(Object item, Description mismatch)

Implements abstract org.hamcrest.DiagnosingMatcher.matches.

Annotations
@Override