public class

LineApiResponse

extends Object
java.lang.Object
   ↳ com.linecorp.linesdk.LineApiResponse<R>

Class Overview

Represents a response from the Social API.

Summary

Public Methods
LineApiError getErrorData()
Gets information about an API error occurred.
LineApiResponseCode getResponseCode()
Gets the response code that is returned.
R getResponseData()
Gets data that is associated with the response if it exists.
boolean isNetworkError()
Checks if the API call fails with a network error.
boolean isServerError()
Checks if the API call fails with a server error.
boolean isSuccess()
Checks if the API call is successful.
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public LineApiError getErrorData ()

Gets information about an API error occurred. This method should only be called if an API call has failed.

Returns
  • The LineApiError object that contains information about the error. If no error occurs, the LineApiError object will not contain any useful information.

public LineApiResponseCode getResponseCode ()

Gets the response code that is returned.

Returns
  • The LineApiResponseCode object containing the HTTP status code which indicates if the API call is successful.

public R getResponseData ()

Gets data that is associated with the response if it exists. If no data is associated with the response, it throws NoSuchElementException. You must check if the response succeeded by using the isSuccess() method before calling this method.

Returns
  • The response data in the same format as the generic type associated with the LineApiResponse class.
Throws
NoSuchElementException if the response data is null.

public boolean isNetworkError ()

Checks if the API call fails with a network error.

Returns
  • True if the API call fails with a network error; false otherwise.

public boolean isServerError ()

Checks if the API call fails with a server error.

Returns
  • True if the API call fails with a server error; false otherwise.

public boolean isSuccess ()

Checks if the API call is successful.

Returns
  • True if the API call is successful; false otherwise.