Class Contract


  • public class Contract
    extends java.lang.Object

    Provides design by contract programming validation functions.

    Since:
    5.0.0
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void isTrue​(boolean value, java.lang.String message)
      Ensure the specified condition value is true, or throw an IllegalArgumentExcpetion if false.
      static void notBlank​(java.lang.String paramValue, java.lang.String paramName)
      Validate specified parameter is not null, or blank throw a IllegalArgumentException if null or blank.
      static void notNull​(java.lang.Object paramValue, java.lang.String paramName)
      Validate specified parameter is not null, throw a IllegalArgumentException if null.
      • Methods inherited from class java.lang.Object

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

      • isTrue

        public static void isTrue​(boolean value,
                                  java.lang.String message)
        Ensure the specified condition value is true, or throw an IllegalArgumentExcpetion if false.
        Parameters:
        value - the conditional value to test
        message - the IllegalArgumentException message if the conditional value is false
      • notNull

        public static void notNull​(java.lang.Object paramValue,
                                   java.lang.String paramName)
        Validate specified parameter is not null, throw a IllegalArgumentException if null.
        Parameters:
        paramValue - the parameter value to verify not null
        paramName - the parameter name
      • notBlank

        public static void notBlank​(java.lang.String paramValue,
                                    java.lang.String paramName)
        Validate specified parameter is not null, or blank throw a IllegalArgumentException if null or blank.
        Parameters:
        paramValue - the parameter value to verify not null, or blank
        paramName - the parameter name