Class JsonRuntimeException

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  JsonRuntimeException.Builder
      A mutable builder for a JsonRuntimeException.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected JsonRuntimeException​(java.lang.String errorCode, java.lang.String message, java.lang.String description, java.lang.Throwable cause, java.net.URI href)
      Constructs a new JsonRuntimeException object with the specified values.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Optional<java.lang.String> getDescription()
      Returns the description which should be reported to the user.
      java.lang.String getErrorCode()
      Returns the error code to uniquely identify this exception.
      java.util.Optional<java.net.URI> getHref()
      Returns a link with which the user can find further information regarding this exception.
      static JsonExceptionBuilder<JsonRuntimeException> newBuilder​(java.lang.String errorCode)
      Returns a builder for fluently creating instances of JsonRuntimeExceptions..
      • Methods inherited from class java.lang.Throwable

        addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
      • Methods inherited from class java.lang.Object

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

      • JsonRuntimeException

        protected JsonRuntimeException​(java.lang.String errorCode,
                                       @Nullable
                                       java.lang.String message,
                                       @Nullable
                                       java.lang.String description,
                                       @Nullable
                                       java.lang.Throwable cause,
                                       @Nullable
                                       java.net.URI href)
        Constructs a new JsonRuntimeException object with the specified values.
        Parameters:
        errorCode - the error code of the exception.
        message - the detail message for later retrieval with Throwable.getMessage().
        description - a description with further information about the exception.
        cause - the cause of the exception for later retrieval with Throwable.getCause().
        href - a link to a resource which provides further information about the exception.
        Throws:
        java.lang.NullPointerException - if errorCode is null.
        java.lang.IllegalArgumentException - if errorCode is empty.
    • Method Detail

      • newBuilder

        public static JsonExceptionBuilder<JsonRuntimeException> newBuilder​(java.lang.String errorCode)
        Returns a builder for fluently creating instances of JsonRuntimeExceptions..
        Parameters:
        errorCode - a code which uniquely identifies the exception.
        Returns:
        a new builder for JsonRuntimeException objects.
        Throws:
        java.lang.NullPointerException - if errorCode is null.
        java.lang.IllegalArgumentException - if errorCode is empty.
      • getErrorCode

        public java.lang.String getErrorCode()
        Description copied from interface: JsonException
        Returns the error code to uniquely identify this exception.
        Specified by:
        getErrorCode in interface JsonException
        Returns:
        the error code.
      • getDescription

        public java.util.Optional<java.lang.String> getDescription()
        Description copied from interface: JsonException
        Returns the description which should be reported to the user.
        Specified by:
        getDescription in interface JsonException
        Returns:
        the description.
      • getHref

        public java.util.Optional<java.net.URI> getHref()
        Description copied from interface: JsonException
        Returns a link with which the user can find further information regarding this exception.
        Specified by:
        getHref in interface JsonException
        Returns:
        a link to provide the user with further information about this exception.