Class CheckerLong

java.lang.Object
util.AbstractChecker<Long,CheckerLong>
specialized_checkers.math.numbers.integerTypes.CheckerLong
All Implemented Interfaces:
InterfaceCheckerNumber<CheckerLong>, InterfaceChecker<AbstractChecker<Long,CheckerLong>,Long>

public class CheckerLong extends AbstractChecker<Long,CheckerLong> implements InterfaceCheckerNumber<CheckerLong>
Checker for Long instances, providing fluent validation methods for long integer numbers.

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

  • Constructor Details

    • CheckerLong

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

    • check

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

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

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

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

      protected CheckerLong self()
      Returns this checker instance (for fluent API usage).
      Specified by:
      self in class AbstractChecker<Long,CheckerLong>
      Returns:
      this CheckerLong instance
    • isEven

      public CheckerLong isEven()
      Asserts that the Long value is even (divisible by two).
      Returns:
      this CheckerLong instance for further validation
    • isOdd

      public CheckerLong isOdd()
      Asserts that the Long value is odd (not divisible by two).
      Returns:
      this CheckerLong instance for further validation
    • isPrime

      public CheckerLong isPrime()
      Asserts that the Long value is prime.
      Returns:
      this CheckerLong instance for further validation
    • isPositive

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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