Class Checks


  • public final class Checks
    extends java.lang.Object
    Since:
    4.13
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <T> T notNull​(T value)
      Checks that the given value is not null.
      static <T> T notNull​(T value, java.lang.String message)
      Checks that the given value is not null, using the given message as the exception message if an exception is thrown.
      • Methods inherited from class java.lang.Object

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

      • notNull

        public static <T> T notNull​(T value)
        Checks that the given value is not null.
        Parameters:
        value - object reference to check
        Returns:
        the passed-in value, if not null
        Throws:
        java.lang.NullPointerException - if value is null
      • notNull

        public static <T> T notNull​(T value,
                                    java.lang.String message)
        Checks that the given value is not null, using the given message as the exception message if an exception is thrown.
        Parameters:
        value - object reference to check
        message - message to use if value is null
        Returns:
        the passed-in value, if not null
        Throws:
        java.lang.NullPointerException - if value is null