Class P4JavaExceptions


  • public final class P4JavaExceptions
    extends java.lang.Object
    Since:
    2/09/2016
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <T,​R>
      Function<T,​R>
      rethrowFunction​(FunctionWithException<T,​R> function)  
      static void throwAccessExceptionIfConditionFails​(boolean expression, java.lang.String message, java.lang.Object... args)
      If the check expression fails; then ConnectionException will throw with given error message message
      static void throwConnectionException​(java.lang.String message, java.lang.Object... args)  
      static void throwConnectionException​(java.lang.Throwable cause)  
      static void throwConnectionException​(java.lang.Throwable cause, java.lang.String message, java.lang.Object... args)  
      static void throwConnectionExceptionIfConditionFails​(boolean expression, java.lang.String message, java.lang.Object... args)
      If the check expression fails; then ConnectionException will throw with given error message message
      static void throwIOException​(java.lang.String message, java.lang.Object... args)  
      static void throwIOException​(java.lang.Throwable cause)  
      static void throwIOException​(java.lang.Throwable cause, java.lang.String message, java.lang.Object... args)  
      static void throwIOExceptionIfConditionFails​(boolean expression, java.lang.String message, java.lang.Object... args)  
      static void throwOptionsException​(java.lang.String message, java.lang.Object... args)  
      static void throwOptionsException​(java.lang.Throwable cause)  
      static void throwOptionsException​(java.lang.Throwable cause, java.lang.String message, java.lang.Object... args)  
      static void throwOptionsExceptionIfConditionFails​(boolean expression, java.lang.String message, java.lang.Object... args)
      If the check expression fails; then ConnectionException will throw with given error message message
      static void throwP4JavaError​(java.lang.String message, java.lang.Object... args)  
      static void throwP4JavaError​(java.lang.Throwable cause, java.lang.String message, java.lang.Object... args)  
      static void throwP4JavaErrorIfConditionFails​(boolean expression, java.lang.String message, java.lang.Object... args)
      If the check expression fails; then ConnectionException will throw with given error message message
      static void throwProtocolErrorIfConditionFails​(boolean expression, java.lang.String message, java.lang.Object... args)
      If the check expression fails; then ConnectionException will throw with given error message message
      static void throwRequestExceptionIfConditionFails​(boolean expression, java.lang.String message, java.lang.Object... args)
      If the check expression fails; then ConnectionException will throw with given error message message
      static void throwRequestExceptionIfConditionFails​(boolean expression, java.lang.String codeString, java.lang.String message, java.lang.Object... args)
      If the check expression fails; then ConnectionException will throw with given error message message
      static void throwRequestExceptionIfPerforceServerVersionOldThanExpected​(boolean expression, java.lang.String message, java.lang.Object... args)  
      • Methods inherited from class java.lang.Object

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

      • throwConnectionExceptionIfConditionFails

        public static void throwConnectionExceptionIfConditionFails​(boolean expression,
                                                                    java.lang.String message,
                                                                    java.lang.Object... args)
                                                             throws ConnectionException
        If the check expression fails; then ConnectionException will throw with given error message message
        Parameters:
        expression - expression
        message - message
        args - args
        Throws:
        ConnectionException - on error
      • throwConnectionException

        public static void throwConnectionException​(java.lang.Throwable cause,
                                                    java.lang.String message,
                                                    java.lang.Object... args)
                                             throws ConnectionException
        Throws:
        ConnectionException
      • throwProtocolErrorIfConditionFails

        public static void throwProtocolErrorIfConditionFails​(boolean expression,
                                                              java.lang.String message,
                                                              java.lang.Object... args)
                                                       throws ProtocolError
        If the check expression fails; then ConnectionException will throw with given error message message
        Parameters:
        expression - expression
        message - message
        args - args
        Throws:
        ProtocolError - on error
      • throwP4JavaErrorIfConditionFails

        public static void throwP4JavaErrorIfConditionFails​(boolean expression,
                                                            java.lang.String message,
                                                            java.lang.Object... args)
                                                     throws P4JavaError
        If the check expression fails; then ConnectionException will throw with given error message message
        Parameters:
        expression - expression
        message - message
        args - args
        Throws:
        P4JavaError - on error
      • throwP4JavaError

        public static void throwP4JavaError​(java.lang.Throwable cause,
                                            java.lang.String message,
                                            java.lang.Object... args)
                                     throws P4JavaError
        Throws:
        P4JavaError
      • throwP4JavaError

        public static void throwP4JavaError​(java.lang.String message,
                                            java.lang.Object... args)
                                     throws P4JavaError
        Throws:
        P4JavaError
      • throwOptionsExceptionIfConditionFails

        public static void throwOptionsExceptionIfConditionFails​(boolean expression,
                                                                 java.lang.String message,
                                                                 java.lang.Object... args)
                                                          throws OptionsException
        If the check expression fails; then ConnectionException will throw with given error message message
        Parameters:
        expression - expression
        message - message
        args - args
        Throws:
        OptionsException - on error
      • throwOptionsException

        public static void throwOptionsException​(java.lang.Throwable cause,
                                                 java.lang.String message,
                                                 java.lang.Object... args)
                                          throws OptionsException
        Throws:
        OptionsException
      • throwOptionsException

        public static void throwOptionsException​(java.lang.String message,
                                                 java.lang.Object... args)
                                          throws OptionsException
        Throws:
        OptionsException
      • throwRequestExceptionIfConditionFails

        public static void throwRequestExceptionIfConditionFails​(boolean expression,
                                                                 java.lang.String codeString,
                                                                 java.lang.String message,
                                                                 java.lang.Object... args)
                                                          throws RequestException
        If the check expression fails; then ConnectionException will throw with given error message message
        Parameters:
        expression - expression
        codeString - codeString
        message - message
        args - args
        Throws:
        RequestException - on error
      • throwRequestExceptionIfConditionFails

        public static void throwRequestExceptionIfConditionFails​(boolean expression,
                                                                 java.lang.String message,
                                                                 java.lang.Object... args)
                                                          throws RequestException
        If the check expression fails; then ConnectionException will throw with given error message message
        Parameters:
        expression - expression
        message - message
        args - args
        Throws:
        RequestException - on error
      • throwRequestExceptionIfPerforceServerVersionOldThanExpected

        public static void throwRequestExceptionIfPerforceServerVersionOldThanExpected​(boolean expression,
                                                                                       java.lang.String message,
                                                                                       java.lang.Object... args)
                                                                                throws RequestException
        Throws:
        RequestException
      • throwAccessExceptionIfConditionFails

        public static void throwAccessExceptionIfConditionFails​(boolean expression,
                                                                java.lang.String message,
                                                                java.lang.Object... args)
                                                         throws AccessException
        If the check expression fails; then ConnectionException will throw with given error message message
        Parameters:
        expression - expression
        message - message
        args - args
        Throws:
        AccessException - on error
      • throwIOException

        public static void throwIOException​(java.lang.Throwable cause)
                                     throws java.io.IOException
        Throws:
        java.io.IOException
      • throwIOException

        public static void throwIOException​(java.lang.Throwable cause,
                                            java.lang.String message,
                                            java.lang.Object... args)
                                     throws java.io.IOException
        Throws:
        java.io.IOException
      • throwIOException

        public static void throwIOException​(java.lang.String message,
                                            java.lang.Object... args)
                                     throws java.io.IOException
        Throws:
        java.io.IOException
      • throwIOExceptionIfConditionFails

        public static void throwIOExceptionIfConditionFails​(boolean expression,
                                                            java.lang.String message,
                                                            java.lang.Object... args)
                                                     throws java.io.IOException
        Throws:
        java.io.IOException