Class Assertions


  • public final class Assertions
    extends java.lang.Object
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void blankCheck​(java.lang.String o, java.lang.String param)
      Throws IllegalArgumentException if the parameter o is null or blank.
      static java.lang.String blankChecked​(java.lang.String o, java.lang.String param)
      Throws IllegalArgumentException if the parameter o is null or blank, otherwise returns the value of the o parameter.
      static void nullCheck​(java.lang.Object o, java.lang.String param)
      Throws NullPointerException if the parameter o is null.
      static <T> T nullChecked​(T o, java.lang.String param)
      Throws NullPointerException if the parameter o is null, otherwise returns the value of the o parameter.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • nullCheck

        public static void nullCheck​(java.lang.Object o,
                                     java.lang.String param)
        Throws NullPointerException if the parameter o is null.
        Parameters:
        o - check if the object is null.
        param - name of the parameter to check for null.
        Throws:
        java.lang.NullPointerException - if o is null and constructs a message with the name of the parameter.
      • nullChecked

        public static <T> T nullChecked​(T o,
                                        java.lang.String param)
        Throws NullPointerException if the parameter o is null, otherwise returns the value of the o parameter.
        Type Parameters:
        T - the type of the value
        Parameters:
        o - check if the object is null.
        param - name of the parameter to check for null.
        Returns:
        the value of the o parameter.
        Throws:
        java.lang.NullPointerException - if o is null and constructs a message with the name of the parameter.
        Since:
        1.1
      • blankCheck

        public static void blankCheck​(java.lang.String o,
                                      java.lang.String param)
        Throws IllegalArgumentException if the parameter o is null or blank.
        Parameters:
        o - value to test for blank.
        param - name of the parameter to check.
      • blankChecked

        public static java.lang.String blankChecked​(java.lang.String o,
                                                    java.lang.String param)
        Throws IllegalArgumentException if the parameter o is null or blank, otherwise returns the value of the o parameter.
        Parameters:
        o - value to test for blank.
        param - name of the parameter to check.
        Returns:
        the value of the o parameter.
        Since:
        1.1