OneResponse (OpenNebula Cloud API)
Description: declaration: package: org.opennebula.client, class: OneResponse

Package org.opennebula.client

# Class OneResponse

java.lang.Object
org.opennebula.client.OneResponse

public class OneResponse extends Object
This class encapsulates OpenNebula's XML-RPC responses. Each response carries a boolean indicating if it is an error. It can also contain a success message, or an error message.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `OneResponse(boolean success, String message)`
  Creates a new response.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `getBooleanMessage()`
  Parses the string returned by getMessage
  `String`
  `getErrorMessage()`
  Returns a string containing the error message, or null if the response isn't an error.
  `int`
  `getIntMessage()`
  Parses the string returned by getMessage
  `String`
  `getMessage()`
  Returns a string containing the response information, or null if the response was an error.
  `boolean`
  `isError()`
  Returns true if the call resulted in error.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### OneResponse

    public OneResponse(boolean success, String message)
    Creates a new response.
    Parameters:
      `success` - Indicates if the call was successful, and if the message is an error or an information string.
      `message` - String containing the response message, or the error message.

- ## Method Details

  - ### isError

    public boolean isError()
    Returns true if the call resulted in error.
    Returns:
      True if the call resulted in error.

  - ### getErrorMessage

    public String getErrorMessage()
    Returns a string containing the error message, or null if the response isn't an error.
    Returns:
      A string containing the error message, or null if the response isn't an error.

  - ### getMessage

    public String getMessage()
    Returns a string containing the response information, or null if the response was an error. Note that the success message could be also null.
    Returns:
      A string containing the response information, or null if the response was an error. Note that the success message could be also null.

  - ### getIntMessage

    public int getIntMessage()
    Parses the string returned by getMessage
    Returns:
      The parsed int, or Integer.MIN_VALUE in case of error
    See Also:
      - `getMessage()`

  - ### getBooleanMessage

    public boolean getBooleanMessage()
    Parses the string returned by getMessage
    Returns:
      The parsed boolean. False in case of error
    See Also:
      - `getMessage()`