net.roarsoftware.lastfm.scrobble
Class ResponseStatus

java.lang.Object
  extended by net.roarsoftware.lastfm.scrobble.ResponseStatus

public class ResponseStatus
extends java.lang.Object

Contains information about the result of a scrobbling operation and an optional error message.

Author:
Janni Kovacs

Field Summary
static int BADAUTH
           
static int BADSESSION
           
static int BADTIME
           
static int BANNED
           
static int FAILED
           
static int OK
           
 
Constructor Summary
ResponseStatus(int status)
           
ResponseStatus(int status, java.lang.String message)
           
 
Method Summary
 java.lang.String getMessage()
          Returns the optional error message, which is only available if status is FAILED, or null, if no message is available.
 int getStatus()
          Returns the result status code of the operation, which is one of the integer constants defined in this class.
 boolean ok()
          Returns true if the operation was successful.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OK

public static final int OK
See Also:
Constant Field Values

BANNED

public static final int BANNED
See Also:
Constant Field Values

BADAUTH

public static final int BADAUTH
See Also:
Constant Field Values

BADTIME

public static final int BADTIME
See Also:
Constant Field Values

BADSESSION

public static final int BADSESSION
See Also:
Constant Field Values

FAILED

public static final int FAILED
See Also:
Constant Field Values
Constructor Detail

ResponseStatus

public ResponseStatus(int status)

ResponseStatus

public ResponseStatus(int status,
                      java.lang.String message)
Method Detail

getMessage

public java.lang.String getMessage()
Returns the optional error message, which is only available if status is FAILED, or null, if no message is available.

Returns:
the error message or null

getStatus

public int getStatus()
Returns the result status code of the operation, which is one of the integer constants defined in this class.

Returns:
the status code

ok

public boolean ok()
Returns true if the operation was successful. Same as getStatus() == ResponseStatus.OK.

Returns:
true if status is OK