org.eclipse.microprofile.fault.tolerance.tck.util

## Class DurationMatcher

- java.lang.Object
- - org.hamcrest.BaseMatcher<T>
  - - org.hamcrest.TypeSafeDiagnosingMatcher<Duration>
    - - org.eclipse.microprofile.fault.tolerance.tck.util.DurationMatcher

All Implemented Interfaces:
  org.hamcrest.Matcher<Duration>, org.hamcrest.SelfDescribing

    public class DurationMatcher
    extends org.hamcrest.TypeSafeDiagnosingMatcher<Duration>

### Constructor Summary

Constructors
Constructor and Description
`DurationMatcher(Duration target, Duration margin)`

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`static DurationMatcher` `closeTo(Duration target)` Matcher that asserts that a duration is within 100ms of `target`
`static DurationMatcher` `closeTo(Duration target, Duration margin)` Matcher that asserts that a duration is within `margin` of `target`
`void` `describeTo(org.hamcrest.Description description)`
`protected boolean` `matchesSafely(Duration item, org.hamcrest.Description mismatchDescription)`

### Methods inherited from class org.hamcrest.TypeSafeDiagnosingMatcher

`describeMismatch, matches`

### Methods inherited from class org.hamcrest.BaseMatcher

`_dont_implement_Matcher___instead_extend_BaseMatcher_, toString`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Constructor Detail

#### DurationMatcher

    public DurationMatcher(Duration target,
                           Duration margin)

### Method Detail

#### describeTo

    public void describeTo(org.hamcrest.Description description)

#### matchesSafely

    protected boolean matchesSafely(Duration item,
                                    org.hamcrest.Description mismatchDescription)

Specified by:
  `matchesSafely` in class `org.hamcrest.TypeSafeDiagnosingMatcher<Duration>`

#### closeTo

    public static DurationMatcher closeTo(Duration target,
                                          Duration margin)

Matcher that asserts that a duration is within `margin` of `target`

Parameters:
  `target` - the target duration
  `margin` - the margin
Returns:
  the matcher

#### closeTo

    public static DurationMatcher closeTo(Duration target)

Matcher that asserts that a duration is within 100ms of `target`

Parameters:
  `target` - the target duration
Returns:
  the matcher