com.nimbusds.oauth2.sdk
Class ErrorObject

java.lang.Object
  extended by com.nimbusds.oauth2.sdk.ErrorObject
Direct Known Subclasses:
BearerTokenError

@Immutable
public class ErrorObject
extends Object

Error object, used to encapsulate OAuth 2.0 and other errors. This class is immutable.

Author:
Vladimir Dzhuvinov

Constructor Summary
ErrorObject(String code)
          Creates a new error with the specified code.
ErrorObject(String code, String description)
          Creates a new error with the specified code and description.
ErrorObject(String code, String description, int httpStatusCode)
          Creates a new error with the specified code, description and HTTP status code.
ErrorObject(String code, String description, int httpStatusCode, URL uri)
          Creates a new error with the specified code, description, HTTP status code and page URI.
 
Method Summary
 ErrorObject appendDescription(String text)
          Appends the specified text to the error description.
 boolean equals(Object object)
           
 String getCode()
          Gets the error code.
 String getDescription()
          Gets the error description.
 int getHTTPStatusCode()
          Gets the HTTP status code.
 URL getURI()
          Gets the error page URI.
 int hashCode()
           
 ErrorObject setDescription(String description)
          Sets the error description.
 ErrorObject setHTTPStatusCode(int httpStatusCode)
          Sets the HTTP status code.
 ErrorObject setURI(URL uri)
          Sets the error page URI.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ErrorObject

public ErrorObject(String code)
Creates a new error with the specified code.

Parameters:
code - The error code, null if not specified.

ErrorObject

public ErrorObject(String code,
                   String description)
Creates a new error with the specified code and description.

Parameters:
code - The error code, null if not specified.
description - The error description, null if not specified.

ErrorObject

public ErrorObject(String code,
                   String description,
                   int httpStatusCode)
Creates a new error with the specified code, description and HTTP status code.

Parameters:
code - The error code, null if not specified.
description - The error description, null if not specified.
httpStatusCode - The HTTP status code, zero if not specified.

ErrorObject

public ErrorObject(String code,
                   String description,
                   int httpStatusCode,
                   URL uri)
Creates a new error with the specified code, description, HTTP status code and page URI.

Parameters:
code - The error code, null if not specified.
description - The error description, null if not specified.
httpStatusCode - The HTTP status code, zero if not specified.
uri - The error page URI, null if not specified.
Method Detail

getCode

public String getCode()
Gets the error code.

Returns:
The error code, null if not specified.

getDescription

public String getDescription()
Gets the error description.

Returns:
The error description, null if not specified.

setDescription

public ErrorObject setDescription(String description)
Sets the error description.

Parameters:
description - The error description, null if not specified.
Returns:
A copy of this error with the specified description.

appendDescription

public ErrorObject appendDescription(String text)
Appends the specified text to the error description.

Parameters:
text - The text to append to the error description, null if not specified.
Returns:
A copy of this error with the specified appended description.

getHTTPStatusCode

public int getHTTPStatusCode()
Gets the HTTP status code.

Returns:
The HTTP status code, zero if not specified.

setHTTPStatusCode

public ErrorObject setHTTPStatusCode(int httpStatusCode)
Sets the HTTP status code.

Parameters:
httpStatusCode - The HTTP status code, zero if not specified.
Returns:
A copy of this error with the specified HTTP status code.

getURI

public URL getURI()
Gets the error page URI.

Returns:
The error page URI, null if not specified.

setURI

public ErrorObject setURI(URL uri)
Sets the error page URI.

Parameters:
uri - The error page URI, null if not specified.
Returns:
A copy of this error with the specified page URI.

toString

public String toString()
Overrides:
toString in class Object
See Also:
getCode()

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object object)
Overrides:
equals in class Object


Copyright © 2013 NimbusDS. All Rights Reserved.