Class ScalarIsCloseTo<S>

  • Type Parameters:
    S - the type of the scalars (elements of the field)
    All Implemented Interfaces:
    org.hamcrest.Matcher<S>, org.hamcrest.SelfDescribing

    public class ScalarIsCloseTo<S>
    extends org.hamcrest.TypeSafeMatcher<S>
    A matcher for base tests, that allows to set a tolerance value. This matcher uses the scalar support of tensorics, thus it can be used on any scalars fro which a field is provided.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void describeTo​(org.hamcrest.Description description)  
      protected boolean matchesSafely​(S valueToAssert)  
      • Methods inherited from class org.hamcrest.TypeSafeMatcher

        describeMismatch, describeMismatchSafely, 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

      • ScalarIsCloseTo

        public ScalarIsCloseTo​(ScalarSupport<S> scalarSupport,
                               S value,
                               S tolerance)
    • Method Detail

      • describeTo

        public void describeTo​(org.hamcrest.Description description)
      • matchesSafely

        protected boolean matchesSafely​(S valueToAssert)
        Specified by:
        matchesSafely in class org.hamcrest.TypeSafeMatcher<S>