Class ArgumentUtils.ArgumentCheck<T>

  • Type Parameters:
    T - The type
    Enclosing class:
    ArgumentUtils

    public static class ArgumentUtils.ArgumentCheck<T>
    extends java.lang.Object
    Allows producing error messages.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void notNull()
      Fail the argument with the given message.
      void orElseFail​(java.lang.String message)
      Fail the argument with the given message.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ArgumentCheck

        public ArgumentCheck​(ArgumentUtils.Check check)
        Parameters:
        check - The check
      • ArgumentCheck

        public ArgumentCheck​(java.lang.String name,
                             T value)
        Parameters:
        name - The name
        value - The value
    • Method Detail

      • orElseFail

        public void orElseFail​(java.lang.String message)
        Fail the argument with the given message.
        Parameters:
        message - The message
        Throws:
        java.lang.IllegalArgumentException - Thrown with the given message if the check fails
      • notNull

        public void notNull()
        Fail the argument with the given message.
        Throws:
        java.lang.NullPointerException - Thrown with the given message if the check fails