Package rocks.cleancode.hamcrest.record
Class HasFieldMatcher<R extends Record,T>
java.lang.Object
org.hamcrest.BaseMatcher<T>
org.hamcrest.TypeSafeDiagnosingMatcher<R>
rocks.cleancode.hamcrest.record.HasFieldMatcher<R,T>
- Type Parameters:
R- Record typeT- Field type
- All Implemented Interfaces:
Matcher<R>,SelfDescribing
Matches a record field.
- Since:
- 1.0.0
-
Method Summary
Modifier and TypeMethodDescriptionvoiddescribeTo(Description description)Create a matcher for field value.Create a matcher for not null field.protected booleanmatchesSafely(R record, Description mismatchDescription)Methods inherited from class org.hamcrest.TypeSafeDiagnosingMatcher
describeMismatch, matchesMethods inherited from class org.hamcrest.BaseMatcher
_dont_implement_Matcher___instead_extend_BaseMatcher_, isNotNull, toString
-
Method Details
-
hasField
Create a matcher for not null field.- Type Parameters:
R- Record type- Parameters:
fieldName- Field name- Returns:
- Not null field matcher
- Since:
- 1.0.0
-
field
Create a matcher for field value.- Type Parameters:
R- Record typeT- Value type- Parameters:
fieldName- Field namevalueMatcher- Value matcher- Returns:
- Value matcher for field record
- Since:
- 1.0.0
-
matchesSafely
- Specified by:
matchesSafelyin classTypeSafeDiagnosingMatcher<R extends Record>
-
describeTo
-