Class AbstractDoubleMediator
java.lang.Object
ch.nolix.base.validation.base.AbstractMediator
ch.nolix.base.validation.primitive.AbstractDoubleMediator
- Direct Known Subclasses:
DoubleMediator, NamableDoubleMediator
- Author:
- Silvan Wyss
-
Field Summary
Fields inherited from class AbstractMediator
DEFAULT_ARGUMENT_NAME -
Method Summary
Modifier and TypeMethodDescriptionfinal voidisBetween(double min, double max) final voidisBiggerThan(double value) final voidisEqualTo(double value) final voidfinal voidisNotBiggerThan(double value) final voidisNotEqualTo(double value) final voidfinal voidfinal voidisNotSmallerThan(double min) final voidfinal voidisSmallerThan(double value) final DoubleDeviationMediatorwithMaxDeviation(double maxDeviation)
-
Method Details
-
isBetween
public final void isBetween(double min, double max) - Parameters:
min-max-- Throws:
RuntimeException- if the argument of the currentAbstractDoubleMediatoris not between the given min and max.
-
isBiggerThan
public final void isBiggerThan(double value) - Parameters:
value-- Throws:
RuntimeException- if the argument of the currentAbstractDoubleMediatoris not bigger than the given value.
-
isEqualTo
public final void isEqualTo(double value) - Parameters:
value-- Throws:
UnequalArgumentException- if the argument of the currentAbstractDoubleMediatordoes not equal the given value.
-
isNegative
public final void isNegative()- Throws:
NonNegativeArgumentException- if the argument of the currentAbstractDoubleMediatoris not negative.
-
isNotBiggerThan
public final void isNotBiggerThan(double value) - Parameters:
value-- Throws:
RuntimeException- if the argument of the currentAbstractDoubleMediatoris bigger than the given value.
-
isNotEqualTo
public final void isNotEqualTo(double value) - Parameters:
value-- Throws:
RuntimeException- if the argument of the currentAbstractDoubleMediatorequals the given value.
-
isNotNegative
public final void isNotNegative()- Throws:
RuntimeException- if the argument of the currentAbstractDoubleMediatoris negative.
-
isNotPositive
public final void isNotPositive()- Throws:
RuntimeException- if the argument of the currentAbstractDoubleMediatoris positive.
-
isNotSmallerThan
public final void isNotSmallerThan(double min) - Parameters:
min-- Throws:
RuntimeException- if the argument of the currentDoubleMediatoris smaller than the given min.
-
isPositive
public final void isPositive()- Throws:
RuntimeException- if the argument of the currentAbstractDoubleMediatoris not positive.
-
isSmallerThan
public final void isSmallerThan(double value) - Parameters:
value-- Throws:
RuntimeException- if the argument of the currentAbstractDoubleMediatoris not smaller than the given value.
-
withMaxDeviation
- Parameters:
maxDeviation-- Returns:
- a new
DoubleDeviationMediatorfor the argument and argumentName of the currentAbstractDoubleMediatorand the given maxDeviation. - Throws:
RuntimeException- if the given maxDeviation is negative.
-