Class Checks


  • public final class Checks
    extends Object
    Since:
    4.13
    • 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:
        NullPointerException - if value is null
      • notNull

        public static <T> T notNull​(T value,
                                    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:
        NullPointerException - if value is null