com.mapquest
Class HTTPException

java.lang.Object
  extended byjava.lang.Throwable
      extended byjava.lang.Exception
          extended bycom.mapquest.MQException
              extended bycom.mapquest.HTTPException
All Implemented Interfaces:
java.io.Serializable

public class HTTPException
extends MQException

Class to extend a normal exception with an extra string for the HTTP response status.

See Also:
Exec, Serialized Form

Constructor Summary
HTTPException(java.lang.String status, java.lang.String message)
          Constructs a HTTPException with the specified HTTP response status and detail message.
 
Method Summary
 boolean equals(java.lang.Object otherObject)
          Compares this object to the specified object.
 java.lang.String getStatus()
          Returns the HTTP response status string.
 int hashCode()
          Returns a hash code for this HTTPException.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HTTPException

public HTTPException(java.lang.String status,
                     java.lang.String message)
Constructs a HTTPException with the specified HTTP response status and detail message.

Parameters:
status - the HTTP response status. Example: 400 Bad Request.
message - the detail message.
Method Detail

getStatus

public java.lang.String getStatus()
Returns the HTTP response status string. Example: 400 Bad Request.

Returns:
the HTTP response status string.

equals

public boolean equals(java.lang.Object otherObject)
Compares this object to the specified object. The result is true if and only if the argument is not null and is a HTTPException object that has same attributes as this object.

Overrides:
equals in class MQException
Parameters:
otherObject - the object to compare this HTTPException against.
Returns:
true if the HTTPException objects are equal; false otherwise.

hashCode

public int hashCode()
Returns a hash code for this HTTPException.

Overrides:
hashCode in class MQException
Returns:
a hash code value for this HTTPException.