Klasse DoubleMediator

java.lang.Object
ch.nolix.core.errorcontrol.validator.DoubleMediator
Bekannte direkte Unterklassen:
ExtendedDoubleMediator

public class DoubleMediator extends Object
A double mediator is a mediator for a double. A double mediator is not mutable.
Version:
2017-01-01
Autor:
Silvan Wyss
  • Felddetails

  • Konstruktordetails

    • DoubleMediator

      protected DoubleMediator(double argument)
      Creates a new DoubleMediator for the given argument.
      Parameter:
      argument -
    • DoubleMediator

      protected DoubleMediator(String argumentName, double argument)
      Creates a new DoubleMediator for the given argument, which has has the given argumentName.
      Parameter:
      argumentName -
      argument -
      Löst aus:
      ArgumentIsNullException - if the given argumentName is null.
      InvalidArgumentException - if the given argumentName is blank.
  • Methodendetails

    • forArgument

      public static DoubleMediator forArgument(double argument)
      Parameter:
      argument -
      Gibt zurück:
      a new DoubleMediator for the given argument.
    • isBetween

      public void isBetween(double min, double max)
      Parameter:
      min -
      max -
      Löst aus:
      ArgumentIsOutOfRangeException - if the argument of this double mediator is not between the given min and max.
    • isBiggerThan

      public void isBiggerThan(double value)
      Parameter:
      value -
      Löst aus:
      InvalidArgumentException - if the argument of this double mediator is not bigger than the given value.
    • isEqualTo

      public void isEqualTo(double value)
      Parameter:
      value -
      Löst aus:
      UnequalArgumentException - if the argument of this double mediator does not equal the given value.
    • isNegative

      public void isNegative()
      Löst aus:
      NonNegativeArgumentException - if the argument of this double mediator is not negative.
    • isNotBiggerThan

      public void isNotBiggerThan(double value)
      Parameter:
      value -
      Löst aus:
      BiggerArgumentException - if the argument of this double mediator is bigger than the given value.
    • isNotEqualTo

      public void isNotEqualTo(double value)
      Parameter:
      value -
      Löst aus:
      EqualArgumentException - if the argument of this double mediator equals the given value.
    • isNotNegative

      public void isNotNegative()
      Löst aus:
      NegativeArgumentException - if the argument of this double mediator is negative.
    • isNotPositive

      public void isNotPositive()
      Löst aus:
      NonPositiveArgumentException - if the argument of this double mediator is positive.
    • isNotSmallerThan

      public void isNotSmallerThan(double value)
      Parameter:
      value -
      Löst aus:
      SmallerArgumentException - if the argument of this double mediator is smaller than the given value.
    • isPositive

      public void isPositive()
      Löst aus:
      NonPositiveArgumentException - if the argument of this double mediator is not positive.
    • isSmallerThan

      public void isSmallerThan(double value)
      Parameter:
      value -
      Löst aus:
      InvalidArgumentException - if the argument of this double mediator is not smaller than the given value.
    • withMaxDeviation

      public DoubleDeviationMediator withMaxDeviation(double maxDeviation)
    • getArgument

      protected double getArgument()
      Gibt zurück:
      the argument of htis double mediator.
    • getArgumentName

      protected final String getArgumentName()
      Gibt zurück:
      the argument name of the current Mediator.