getStatusCode
getStatusCode()
getStatusCode メソッドは、レスポンス・オブジェクトのステータス・コードを返します。
戻り値
レスポンス・オブジェクトは整数を返します。
*
*
*
以下に、エラー処理で getStatusCode の使用方法の例を示します。
public static void processSetDebugResponse(Response response)
{
// check if response is successful or not
if(response.getStatusCode() == Response.STATUS_SUCCESS)
{
System.out.println("setDebug call processed with no warnings or errors");
}
else if(response.getStatusCode() == Response.STATUS_WARNING)
{
System.out.println("setDebug call processed with a warning");
}
else
{
System.out.println("setDebug call processed with an error");
}

// For any non-successes, there should be advisory messages explaining why
if(response.getStatusCode() != Response.STATUS_SUCCESS)
printDetailMessageOfWarningOrError("setDebug",
response.getAdvisoryMessages());
}