Class DoubleDeviationMediator
java.lang.Object
ch.nolix.base.validation.base.AbstractMediator
ch.nolix.base.validation.primitive.DoubleDeviationMediator
- Author:
- Silvan Wyss
-
Field Summary
Fields inherited from class AbstractMediator
DEFAULT_ARGUMENT_NAME -
Method Summary
Modifier and TypeMethodDescriptionstatic DoubleDeviationMediatorforArgumentAndArgumentNameAndMaxDeviation(double argument, String argumentName, double maxDeviation) voidisEqualTo(double value)
-
Method Details
-
forArgumentAndArgumentNameAndMaxDeviation
public static DoubleDeviationMediator forArgumentAndArgumentNameAndMaxDeviation(double argument, String argumentName, double maxDeviation) - Parameters:
argument-argumentName-maxDeviation-- Returns:
- a
DoubleDeviationMediatorwith 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.
-