mobi.voiceassistant.base
Class Request
java.lang.Object
mobi.voiceassistant.base.Request
- All Implemented Interfaces:
- Parcelable
public final class Request
- extends Object
- implements Parcelable
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CREATOR
public static final Parcelable.Creator<Request> CREATOR
Request
public Request(PendingRequest pendingRequest,
Uri uri,
Bundle cookies)
Request
public Request(Parcel parcel)
writeToParcel
public void writeToParcel(Parcel parcel,
int flags)
- Specified by:
writeToParcel
in interface Parcelable
getSession
public Session getSession()
getAction
public String getAction()
- Action of
PendingRequest
used for this Request.
- See Also:
PendingRequest.getAction()
getUri
public Uri getUri()
getOrigin
public Uri getOrigin()
- Origin of
PendingRequest
used for this Request.
- See Also:
PendingRequest.getOrigin()
getComponent
public ComponentName getComponent()
- Component of
PendingRequest
used for this Request.
- See Also:
PendingRequest.getComponent()
getDispatch
public ResId getDispatch()
- Dispatch id of
PendingRequest
used for this Request.
- See Also:
PendingRequest.getDispatch()
getDispatchId
public int getDispatchId()
- Dispatch
PendingRequest
used for this Request.
- See Also:
PendingRequest.getDispatch()
getToken
@Deprecated
public Token getToken()
- Deprecated. use
getContent()
getContent
public <T> T getContent()
- Content of
PendingRequest
used for this Request.
- See Also:
PendingRequest.getContent()
getBundleContent
public Bundle getBundleContent()
- Shortcut method to get not-null content bundle.
- Returns:
getContent()
when content is Bundle
and Bundle.EMPTY
when
content is null
- Throws:
ClassCastException
- when content is not Bundle
getBundleIntContent
public int getBundleIntContent(String key)
- See Also:
getBundleContent()
,
PendingRequest.Builder.putBundleContent(String, int)
getBundleIntContent
public int getBundleIntContent(String key,
int defaultValue)
- See Also:
getBundleContent()
,
PendingRequest.Builder.putBundleContent(String, int)
getBundleParcelableContent
public Parcelable getBundleParcelableContent(String key)
- See Also:
getBundleContent()
,
PendingRequest.Builder.putBundleContent(String, Parcelable)
getBundleStringContent
public String getBundleStringContent(String key)
- See Also:
getBundleContent()
,
PendingRequest.Builder.putBundleContent(String, String)
getMarshalContent
public <T> T getMarshalContent()
getMarshalContent
public <T> T getMarshalContent(ClassLoader loader)
getCookies
public Bundle getCookies()
getDoubleCookie
public double getDoubleCookie(String key)
- See Also:
Response.putCookie(int, String, double)
getIntCookie
public int getIntCookie(String key)
- See Also:
Response.putCookie(int, String, int)
getIntCookie
public int getIntCookie(String key,
int defaultValue)
- See Also:
Response.putCookie(int, String, int)
getLongCookie
public long getLongCookie(String key)
- See Also:
Response.putCookie(int, String, long)
getLongCookie
public long getLongCookie(String key,
long defaultValue)
- See Also:
Response.putCookie(int, String, long)
getMarshalCookie
public <T> T getMarshalCookie(String key)
getMarshalCookie
public <T> T getMarshalCookie(String key,
ClassLoader loader)
getParcelableCookie
public <T extends Parcelable> T getParcelableCookie(String key)
- See Also:
Response.putCookie(int, String, Parcelable)
getStringCookie
public String getStringCookie(String key)
- See Also:
Response.putCookie(int, String, String)
getStringArrayListCookie
public ArrayList<String> getStringArrayListCookie(String key)
- See Also:
Response.putStringArrayListCookie(int, String, ArrayList)
createResponse
public Response createResponse()
- Creates new
Response
bound to this request. Created response not yet sent to
assistant. To display response to user need to call Response.setContent(Object)
and
addResponse(Response)
.
- Returns:
- created
Response
- See Also:
addQuickResponse(Object)
addResponse
public void addResponse(Response response)
- Sends
Response
to assistant.
- See Also:
createResponse()
,
addQuickResponse(Object)
removeResponse
public void removeResponse(Response response)
updateResponse
public void updateResponse(Response response)
replaceResponse
public void replaceResponse(Response oldResponse,
Response withResponse)
addQuickResponse
public void addQuickResponse(Object content)
- Creates and adds
Response
with specified content. Shortcut for
createResponse()
, Response.setContent(Object)
and addResponse(Response)
.
- Parameters:
content
- Response's content.
addThrowableResponse
public void addThrowableResponse(Throwable throwable)
generateTag
protected String generateTag()
putResponse
public void putResponse(Uri uri,
Response response)
verifyUri
protected void verifyUri(Uri uri)
generateResponseUri
public Uri generateResponseUri()
processRequest
public void processRequest(PendingRequest request)
processInput
public void processInput(PendingInput input)
createSessionContext
public Context createSessionContext(Context base)
describeContents
public int describeContents()
- Specified by:
describeContents
in interface Parcelable