Class Matchers.IsWithin<T extends java.lang.Number>

  • Type Parameters:
    T - Value type
    All Implemented Interfaces:
    org.hamcrest.Matcher<T>, org.hamcrest.SelfDescribing
    Enclosing class:

    public static class Matchers.IsWithin<T extends java.lang.Number>
    extends org.hamcrest.BaseMatcher<T>
    Is the numeric value within a given difference another value?
    • Field Summary

      Modifier and Type Field Description
      private double epsilon  
      private T expectedValue  
    • Constructor Summary

      Constructor Description
      IsWithin​(T expectedValue, double epsilon)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void describeTo​(org.hamcrest.Description description)  
      private static boolean isWithin​(java.lang.Object actual, java.lang.Number expected, double epsilon)  
      boolean matches​(java.lang.Object actualValue)  
      • Methods inherited from class org.hamcrest.BaseMatcher

        _dont_implement_Matcher___instead_extend_BaseMatcher_, describeMismatch, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • expectedValue

        private final T extends java.lang.Number expectedValue
      • epsilon

        private final double epsilon
    • Constructor Detail

      • IsWithin

        public IsWithin​(T expectedValue,
                        double epsilon)
    • Method Detail

      • matches

        public boolean matches​(java.lang.Object actualValue)
      • describeTo

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

        private static boolean isWithin​(java.lang.Object actual,
                                        java.lang.Number expected,
                                        double epsilon)