Class PioneerPreconditions


  • public class PioneerPreconditions
    extends java.lang.Object
    Pioneer-internal utility class to handle preconditions. DO NOT USE THIS CLASS - IT MAY CHANGE SIGNIFICANTLY IN ANY MINOR UPDATE.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String notBlank​(java.lang.String str, java.lang.String message)
      Asserts that the supplied string is not blank.
      static java.lang.String notBlank​(java.lang.String str, java.util.function.Supplier<java.lang.String> messageSupplier)
      Asserts that the supplied string is not blank.
      static <T extends java.util.Collection<?>>
      T
      notEmpty​(T collection, java.lang.String message)
      Asserts that the supplied collection is not empty.
      static <T extends java.util.Collection<?>>
      T
      notEmpty​(T collection, java.util.function.Supplier<java.lang.String> messageSupplier)
      Asserts that the supplied collection is not empty.
      static <T> T notNull​(T object, java.lang.String message)
      Asserts that the supplied object is not null.
      static <T> T notNull​(T object, java.util.function.Supplier<java.lang.String> messageSupplier)
      Asserts that the supplied object is not null.
      • Methods inherited from class java.lang.Object

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

      • PioneerPreconditions

        private PioneerPreconditions()
    • Method Detail

      • notBlank

        public static java.lang.String notBlank​(java.lang.String str,
                                                java.lang.String message)
        Asserts that the supplied string is not blank.
        Parameters:
        str - the string to check
        message - the precondition violation message
        Returns:
        the supplied string
      • notBlank

        public static java.lang.String notBlank​(java.lang.String str,
                                                java.util.function.Supplier<java.lang.String> messageSupplier)
        Asserts that the supplied string is not blank.
        Parameters:
        str - the string to check
        messageSupplier - the precondition violation message supplier
        Returns:
        the supplied string
      • notNull

        public static <T> T notNull​(T object,
                                    java.lang.String message)
        Asserts that the supplied object is not null.
        Parameters:
        object - the object to check
        message - the precondition violation message
        Returns:
        the supplied object
      • notNull

        public static <T> T notNull​(T object,
                                    java.util.function.Supplier<java.lang.String> messageSupplier)
        Asserts that the supplied object is not null.
        Parameters:
        object - the object to check
        messageSupplier - the precondition violation message supplier
        Returns:
        the supplied object
      • notEmpty

        public static <T extends java.util.Collection<?>> T notEmpty​(T collection,
                                                                     java.lang.String message)
        Asserts that the supplied collection is not empty.
        Parameters:
        collection - the collection to check
        message - the precondition violation message
        Returns:
        the supplied string
      • notEmpty

        public static <T extends java.util.Collection<?>> T notEmpty​(T collection,
                                                                     java.util.function.Supplier<java.lang.String> messageSupplier)
        Asserts that the supplied collection is not empty.
        Parameters:
        collection - the collection to check
        messageSupplier - the precondition violation message supplier
        Returns:
        the supplied string