Class JaxrsNotFoundException

    • Field Detail

      • CODE

        public static final int CODE
        The status code for all instances of this exception.
        See Also:
        Constant Field Values
    • Constructor Detail

      • JaxrsNotFoundException

        public JaxrsNotFoundException​(Throwable cause)
        New instance with given cause and 404 status code.
        Parameters:
        cause - the cause of this exception
      • JaxrsNotFoundException

        public JaxrsNotFoundException​(String message)
        New instance with given message and 404 status code.
        Parameters:
        message - the message for this exception
      • JaxrsNotFoundException

        public JaxrsNotFoundException​(String message,
                                      Throwable cause)
        New instance with given message, cause, and 404 status code.
        Parameters:
        message - the message for this exception
        cause - the cause of this exception
      • JaxrsNotFoundException

        public JaxrsNotFoundException​(String type,
                                      String itemId)
        New instance with given type and item ID. Resulting message is built using buildMessage(String, Object).
        Parameters:
        type - the type of object that was not found
        itemId - the unique key/identifier of the object that was not found
      • JaxrsNotFoundException

        public JaxrsNotFoundException​(String type,
                                      Object itemId)
        New instance with given type and item ID. Resulting message is built using buildMessage(String, Object).
        Parameters:
        type - the type of object that was not found
        itemId - the unique key/identifier of the object that was not found
    • Method Detail

      • buildMessage

        public static String buildMessage​(String type,
                                          Object key)
        Build a generic "not found" message using the given type and key.

        Format: [type] [key] wsa not found.

        Example: User 42 was not found.

        Parameters:
        type - the type of object that was not found
        key - the unique key/identifier of the object that was not found
        Returns:
        the generic "not found" message