Class CorePreconditions


  • public class CorePreconditions
    extends java.lang.Object
    Preconditions util class to check the condition state of variables, functions,...
    This class likely Guava Precondition (I don't know which version from Spigot, Bukkit support this)
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void argument​(boolean express)
      Check argument express
      static void argument​(boolean express, java.lang.String message)
      Check argument express with message.
      static <T> void notNull​(T which)
      Check not null to template class
      static <T> void notNull​(T which, java.lang.String message)
      Check not null to template class.
      static void state​(boolean express)
      Check state is legit with boolean express.
      static void state​(boolean express, java.lang.String message)
      Check state is legit with boolean express.
      • Methods inherited from class java.lang.Object

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

      • CorePreconditions

        public CorePreconditions()
    • Method Detail

      • notNull

        public static <T> void notNull​(T which,
                                       java.lang.String message)
        Check not null to template class.
        Type Parameters:
        T - Template object to check not null
        Parameters:
        which - The object to check not null
        message - The message of NullPointerException catch
      • notNull

        public static <T> void notNull​(T which)
        Check not null to template class
        Type Parameters:
        T - Template object to check not null
        Parameters:
        which - The object to check not null
      • argument

        public static void argument​(boolean express)
        Check argument express
        Parameters:
        express - The boolean express of that arguments
        Throws:
        java.lang.IllegalArgumentException - When the express is wrong
      • argument

        public static void argument​(boolean express,
                                    java.lang.String message)
        Check argument express with message.
        Parameters:
        express - The boolean express of that arguments
        message - The message will send to IllegalArgumentException
        Throws:
        java.lang.IllegalArgumentException - When the express is wrong
      • state

        public static void state​(boolean express,
                                 java.lang.String message)
        Check state is legit with boolean express.
        Parameters:
        express - The boolean express
        message - The message will send IllegalStateException
        Throws:
        java.lang.IllegalStateException - When the express is wrong
      • state

        public static void state​(boolean express)
        Check state is legit with boolean express.
        Parameters:
        express - The boolean express
        Throws:
        java.lang.IllegalStateException - When the express is wrong