public class

ErrorDomain.ErrorCode

extends Object
implements ErrorContent
java.lang.Object
   ↳ com.google.gdata.util.ErrorDomain.ErrorCode

Class Overview

ErrorCode objects represent an error code within an error domain. An inner class is used to make it difficult to construct an ErrorCode that accidentally refers to the wrong subclass of ErrorDomain, or to have more than one ErrorDomain object of the same subclass.

An ErrorCode is immutable. The withInternalReason(String), withExtendedHelp(String), and withSendReport(String) methods can be used to create new ErrorCodes as modified versions of existing ones.

Summary

Fields
private final String codeName
private final String extendedHelp
private final String internalReason
private final String sendReport
Public Constructors
ErrorDomain.ErrorCode(String codeName)
Construct a new error code with the given code name.
Public Methods
String getCodeName()
Gets the name of this ErrorCode, which must be unique within its domain.
String getDebugInfo()
Returns debugging information.
String getDomainName()
Retrieve the name of the domain of this ErrorCode.
String getExtendedHelp()
Gets the extended help URI.
String getInternalReason()
Gets the internal reason (unlocalized explanation) associated with this ErrorCode.
String getLocation()
Return the location of the error.
ErrorContent.LocationType getLocationType()
Return the type of error location.
String getSendReport()
Gets the URI to which a report should be sent when this error is received.
ErrorDomain.ErrorCode setInternalReason(String newInternalReason)
This method is deprecated. Use withInternalReason(String) instead.
ErrorDomain.ErrorCode withExtendedHelp(String newExtendedHelp)
Returns a copy of this ErrorCode with the given extended help URI set.
ErrorDomain.ErrorCode withInternalReason(String newInternalReason)
Returns a copy of this ErrorCode with the given internal reason (un-internationalized explanation) set.
ErrorDomain.ErrorCode withSendReport(String newSendReport)
Returns a copy of this ErrorCode with the given send report URI set.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.google.gdata.util.ErrorContent

Fields

private final String codeName

private final String extendedHelp

private final String internalReason

private final String sendReport

Public Constructors

public ErrorDomain.ErrorCode (String codeName)

Construct a new error code with the given code name.

Parameters
codeName The codename of this error code, must not be null.

Public Methods

public String getCodeName ()

Gets the name of this ErrorCode, which must be unique within its domain. The value will appear as the content of the code element in the XML error format.

public String getDebugInfo ()

Returns debugging information.

public String getDomainName ()

Retrieve the name of the domain of this ErrorCode.

public String getExtendedHelp ()

Gets the extended help URI. This can be used to retrieve a detailed explanation of the error code. The value will appear as the content of the extendedHelp element in the XML error format.

public String getInternalReason ()

Gets the internal reason (unlocalized explanation) associated with this ErrorCode. The value will appear as the content of the internalReason element in the XML error format.

public String getLocation ()

Return the location of the error.

public ErrorContent.LocationType getLocationType ()

Return the type of error location. See ErrorContent.LocationType for the available values.

public String getSendReport ()

Gets the URI to which a report should be sent when this error is received. The value will appear as the content of the sendReport element in the XML error format.

public ErrorDomain.ErrorCode setInternalReason (String newInternalReason)

This method is deprecated.
Use withInternalReason(String) instead.

Parameters
newInternalReason

public ErrorDomain.ErrorCode withExtendedHelp (String newExtendedHelp)

Returns a copy of this ErrorCode with the given extended help URI set. This can be used to provide a detailed explanation of the error code. The value will appear as the content of the extendedHelp element in the XML error format.

Parameters
newExtendedHelp

public ErrorDomain.ErrorCode withInternalReason (String newInternalReason)

Returns a copy of this ErrorCode with the given internal reason (un-internationalized explanation) set. The value will appear as the content of the internalReason element in the XML error format.

Parameters
newInternalReason

public ErrorDomain.ErrorCode withSendReport (String newSendReport)

Returns a copy of this ErrorCode with the given send report URI set. This can be used to provide a URI to which a report should be sent when the error is received. The value will appear as the content of the sendReport element in the XML error format.

Parameters
newSendReport