Class CheckerFloat

java.lang.Object
util.AbstractChecker<Float,CheckerFloat>
specialized_checkers.math.numbers.decimalTypes.CheckerFloat
All Implemented Interfaces:
InterfaceCheckerNumber<CheckerFloat>, InterfaceChecker<AbstractChecker<Float,CheckerFloat>,Float>

public class CheckerFloat extends AbstractChecker<Float,CheckerFloat> implements InterfaceCheckerNumber<CheckerFloat>
Checker for Float instances, providing fluent validation methods for single-precision floating-point numbers.

This class allows you to validate and assert properties of Float objects in a fluent and readable way.

  • Constructor Details

    • CheckerFloat

      protected CheckerFloat(Float nFloat, String name)
      Constructs a new CheckerFloat with the specified nFloat and name.
      Parameters:
      nFloat - the Float to be wrapped and checked
      name - the name identifying this checker function
  • Method Details

    • check

      public static CheckerFloat check(Float number, String name)
      Creates a new CheckerFloat for the given Float instance with a custom name.
      Parameters:
      number - the Float instance to be checked
      name - the name to identify this checker instance (useful for error messages)
      Returns:
      a new CheckerFloat for the provided Float
    • check

      public static CheckerFloat check(Number number, String name)
      Creates a new CheckerFloat for the given Number instance with a custom name.
      Parameters:
      number - the Number instance to be checked (converted to float)
      name - the name to identify this checker instance (useful for error messages)
      Returns:
      a new CheckerFloat for the provided Number
    • check

      public static CheckerFloat check(Float number)
      Creates a new CheckerFloat for the given Float instance with a default name.
      Parameters:
      number - the Float instance to be checked
      Returns:
      a new CheckerFloat for the provided Float
    • check

      public static CheckerFloat check(Number number)
      Creates a new CheckerFloat for the given Number instance with a default name.
      Parameters:
      number - the Number instance to be checked (converted to float)
      Returns:
      a new CheckerFloat for the provided Number
    • self

      protected CheckerFloat self()
      Returns this checker instance (for fluent API usage).
      Specified by:
      self in class AbstractChecker<Float,CheckerFloat>
      Returns:
      this CheckerFloat instance
    • isNaN

      public CheckerFloat isNaN()
      Asserts that the Float value is NaN (not a number).
      Returns:
      this CheckerFloat instance for further validation
    • isInfinite

      public CheckerFloat isInfinite()
      Asserts that the Float value is infinite.
      Returns:
      this CheckerFloat instance for further validation
    • isPositive

      public CheckerFloat isPositive()
      Asserts that the Float value is positive (greater than zero).
      Specified by:
      isPositive in interface InterfaceCheckerNumber<CheckerFloat>
      Returns:
      this CheckerFloat instance for further validation
    • isPositiveOrZero

      public CheckerFloat isPositiveOrZero()
      Asserts that the Float value is positive or zero (greater than or equal to zero).
      Specified by:
      isPositiveOrZero in interface InterfaceCheckerNumber<CheckerFloat>
      Returns:
      this CheckerFloat instance for further validation
    • isNegative

      public CheckerFloat isNegative()
      Asserts that the Float value is negative (less than zero).
      Specified by:
      isNegative in interface InterfaceCheckerNumber<CheckerFloat>
      Returns:
      this CheckerFloat instance for further validation
    • isNegativeOrZero

      public CheckerFloat isNegativeOrZero()
      Asserts that the Float value is negative or zero (less than or equal to zero).
      Specified by:
      isNegativeOrZero in interface InterfaceCheckerNumber<CheckerFloat>
      Returns:
      this CheckerFloat instance for further validation
    • isZero

      public CheckerFloat isZero()
      Asserts that the Float value is zero.
      Specified by:
      isZero in interface InterfaceCheckerNumber<CheckerFloat>
      Returns:
      this CheckerFloat instance for further validation
    • isGreaterThan

      public CheckerFloat isGreaterThan(Byte number)
      Asserts that the Float value is greater than the specified Byte value.
      Specified by:
      isGreaterThan in interface InterfaceCheckerNumber<CheckerFloat>
      Parameters:
      number - the Byte value to compare against
      Returns:
      this CheckerFloat instance for further validation
    • isGreaterThan

      public CheckerFloat isGreaterThan(Short number)
      Asserts that the Float value is greater than the specified Short value.
      Specified by:
      isGreaterThan in interface InterfaceCheckerNumber<CheckerFloat>
      Parameters:
      number - the Short value to compare against
      Returns:
      this CheckerFloat instance for further validation
    • isGreaterThan

      public CheckerFloat isGreaterThan(Integer number)
      Asserts that the Float value is greater than the specified Integer value.
      Specified by:
      isGreaterThan in interface InterfaceCheckerNumber<CheckerFloat>
      Parameters:
      number - the Integer value to compare against
      Returns:
      this CheckerFloat instance for further validation
    • isGreaterThan

      public CheckerFloat isGreaterThan(Long number)
      Asserts that the Float value is greater than the specified Long value.
      Specified by:
      isGreaterThan in interface InterfaceCheckerNumber<CheckerFloat>
      Parameters:
      number - the Long value to compare against
      Returns:
      this CheckerFloat instance for further validation
    • isGreaterThan

      public CheckerFloat isGreaterThan(Float number)
      Asserts that the Float value is greater than the specified Float value.
      Specified by:
      isGreaterThan in interface InterfaceCheckerNumber<CheckerFloat>
      Parameters:
      number - the Float value to compare against
      Returns:
      this CheckerFloat instance for further validation
    • isGreaterThan

      public CheckerFloat isGreaterThan(Double number)
      Asserts that the Float value is greater than the specified Double value.
      Specified by:
      isGreaterThan in interface InterfaceCheckerNumber<CheckerFloat>
      Parameters:
      number - the Double value to compare against
      Returns:
      this CheckerFloat instance for further validation
    • isGreaterOrEqualTo

      public CheckerFloat isGreaterOrEqualTo(Byte number)
      Asserts that the Float value is greater than or equal to the specified Byte value.
      Specified by:
      isGreaterOrEqualTo in interface InterfaceCheckerNumber<CheckerFloat>
      Parameters:
      number - the Byte value to compare against
      Returns:
      this CheckerFloat instance for further validation
    • isGreaterOrEqualTo

      public CheckerFloat isGreaterOrEqualTo(Short number)
      Asserts that the Float value is greater than or equal to the specified Short value.
      Specified by:
      isGreaterOrEqualTo in interface InterfaceCheckerNumber<CheckerFloat>
      Parameters:
      number - the Short value to compare against
      Returns:
      this CheckerFloat instance for further validation
    • isGreaterOrEqualTo

      public CheckerFloat isGreaterOrEqualTo(Integer number)
      Asserts that the Float value is greater than or equal to the specified Integer value.
      Specified by:
      isGreaterOrEqualTo in interface InterfaceCheckerNumber<CheckerFloat>
      Parameters:
      number - the Integer value to compare against
      Returns:
      this CheckerFloat instance for further validation
    • isGreaterOrEqualTo

      public CheckerFloat isGreaterOrEqualTo(Long number)
      Asserts that the Float value is greater than or equal to the specified Long value.
      Specified by:
      isGreaterOrEqualTo in interface InterfaceCheckerNumber<CheckerFloat>
      Parameters:
      number - the Long value to compare against
      Returns:
      this CheckerFloat instance for further validation
    • isGreaterOrEqualTo

      public CheckerFloat isGreaterOrEqualTo(Float number)
      Asserts that the Float value is greater than or equal to the specified Float value.
      Specified by:
      isGreaterOrEqualTo in interface InterfaceCheckerNumber<CheckerFloat>
      Parameters:
      number - the Float value to compare against
      Returns:
      this CheckerFloat instance for further validation
    • isGreaterOrEqualTo

      public CheckerFloat isGreaterOrEqualTo(Double number)
      Asserts that the Float value is greater than or equal to the specified Double value.
      Specified by:
      isGreaterOrEqualTo in interface InterfaceCheckerNumber<CheckerFloat>
      Parameters:
      number - the Double value to compare against
      Returns:
      this CheckerFloat instance for further validation
    • isLessThan

      public CheckerFloat isLessThan(Byte number)
      Asserts that the Float value is less than the specified Byte value.
      Specified by:
      isLessThan in interface InterfaceCheckerNumber<CheckerFloat>
      Parameters:
      number - the Byte value to compare against
      Returns:
      this CheckerFloat instance for further validation
    • isLessThan

      public CheckerFloat isLessThan(Short number)
      Asserts that the Float value is less than the specified Short value.
      Specified by:
      isLessThan in interface InterfaceCheckerNumber<CheckerFloat>
      Parameters:
      number - the Short value to compare against
      Returns:
      this CheckerFloat instance for further validation
    • isLessThan

      public CheckerFloat isLessThan(Integer number)
      Asserts that the Float value is less than the specified Integer value.
      Specified by:
      isLessThan in interface InterfaceCheckerNumber<CheckerFloat>
      Parameters:
      number - the Integer value to compare against
      Returns:
      this CheckerFloat instance for further validation
    • isLessThan

      public CheckerFloat isLessThan(Long number)
      Asserts that the Float value is less than the specified Long value.
      Specified by:
      isLessThan in interface InterfaceCheckerNumber<CheckerFloat>
      Parameters:
      number - the Long value to compare against
      Returns:
      this CheckerFloat instance for further validation
    • isLessThan

      public CheckerFloat isLessThan(Float number)
      Asserts that the Float value is less than the specified Float value.
      Specified by:
      isLessThan in interface InterfaceCheckerNumber<CheckerFloat>
      Parameters:
      number - the Float value to compare against
      Returns:
      this CheckerFloat instance for further validation
    • isLessThan

      public CheckerFloat isLessThan(Double number)
      Asserts that the Float value is less than the specified Double value.
      Specified by:
      isLessThan in interface InterfaceCheckerNumber<CheckerFloat>
      Parameters:
      number - the Double value to compare against
      Returns:
      this CheckerFloat instance for further validation
    • isLessOrEqualTo

      public CheckerFloat isLessOrEqualTo(Byte number)
      Asserts that the Float value is less than or equal to the specified Byte value.
      Specified by:
      isLessOrEqualTo in interface InterfaceCheckerNumber<CheckerFloat>
      Parameters:
      number - the Byte value to compare against
      Returns:
      this CheckerFloat instance for further validation
    • isLessOrEqualTo

      public CheckerFloat isLessOrEqualTo(Short number)
      Asserts that the Float value is less than or equal to the specified Short value.
      Specified by:
      isLessOrEqualTo in interface InterfaceCheckerNumber<CheckerFloat>
      Parameters:
      number - the Short value to compare against
      Returns:
      this CheckerFloat instance for further validation
    • isLessOrEqualTo

      public CheckerFloat isLessOrEqualTo(Integer number)
      Asserts that the Float value is less than or equal to the specified Integer value.
      Specified by:
      isLessOrEqualTo in interface InterfaceCheckerNumber<CheckerFloat>
      Parameters:
      number - the Integer value to compare against
      Returns:
      this CheckerFloat instance for further validation
    • isLessOrEqualTo

      public CheckerFloat isLessOrEqualTo(Long number)
      Asserts that the Float value is less than or equal to the specified Long value.
      Specified by:
      isLessOrEqualTo in interface InterfaceCheckerNumber<CheckerFloat>
      Parameters:
      number - the Long value to compare against
      Returns:
      this CheckerFloat instance for further validation
    • isLessOrEqualTo

      public CheckerFloat isLessOrEqualTo(Float number)
      Asserts that the Float value is less than or equal to the specified Float value.
      Specified by:
      isLessOrEqualTo in interface InterfaceCheckerNumber<CheckerFloat>
      Parameters:
      number - the Float value to compare against
      Returns:
      this CheckerFloat instance for further validation
    • isLessOrEqualTo

      public CheckerFloat isLessOrEqualTo(Double number)
      Asserts that the Float value is less than or equal to the specified Double value.
      Specified by:
      isLessOrEqualTo in interface InterfaceCheckerNumber<CheckerFloat>
      Parameters:
      number - the Double value to compare against
      Returns:
      this CheckerFloat instance for further validation