Class DoubleDeviationMediator

java.lang.Object
ch.nolix.base.validation.base.AbstractMediator
ch.nolix.base.validation.primitive.DoubleDeviationMediator

public final class DoubleDeviationMediator extends AbstractMediator
Author:
Silvan Wyss
  • Method Details

    • forArgumentAndArgumentNameAndMaxDeviation

      public static DoubleDeviationMediator forArgumentAndArgumentNameAndMaxDeviation(double argument, String argumentName, double maxDeviation)
      Parameters:
      argument -
      argumentName -
      maxDeviation -
      Returns:
      a DoubleDeviationMediator with the given argument, argumentName and maxDeviation.
      Throws:
      RuntimeException - if the given argumentName is null or blank.
      RuntimeException - if the given maxDeviation is negative.
    • isEqualTo

      public void isEqualTo(double value)
      Parameters:
      value -
      Throws:
      UnequalArgumentException - if the argument of this named double deviation mediator does not equal the given value with a deviation that is not bigger than the max deviation of this named double deviation mediator.