|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object mobi.voiceassistant.base.AgentUris
public final class AgentUris
Utility class for building and parsing different assist Uris.
Method Summary | |
---|---|
static Uri |
buildBaseUri(String authority,
Locale locale)
Base uri for Dispatcher. |
static Uri |
buildRequestUri(String authority,
Locale locale,
ComponentName component,
String tag)
Uri for Request . |
static boolean |
isBaseUri(Uri uri)
Checks if provided uri has no request parts specified. |
static ComponentName |
parseComponent(Uri uri)
Extracts component name of agent or null if Uri does not contain agent
specification (i.e. |
static Locale |
parseLocale(Uri uri)
Returns locale specified in provided Uri or null . |
static String |
parsePackageName(Uri uri)
Extracts package name of agent or null if Uri does not contain agent
specification (i.e. |
static String |
parseRequestTag(Uri uri)
Returns request tag or null if provided Uri does not denote request. |
static String |
parseResponseTag(Uri uri)
Returns response tag or null if provided Uri does not denote response. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static Uri buildBaseUri(String authority, Locale locale)
assist://authority/xx/XX/
when locale's language nad country are not empty.
assist://authority/
when locale is null
authority
- Denotes dispatcherlocale
- Locale of assistantpublic static Uri buildRequestUri(String authority, Locale locale, ComponentName component, String tag)
Request
.
assist://authority/xx/XX/packageName/className/tag
authority
- Denotes dispatcherlocale
- Locale of assistantcomponent
- Agent's componenttag
- Request tagbuildBaseUri(String, Locale)
public static boolean isBaseUri(Uri uri)
buildBaseUri(String, Locale)
public static Locale parseLocale(Uri uri)
Uri
or null
.
uri
- Uri to checkpublic static String parsePackageName(Uri uri)
null
if Uri does not contain agent
specification (i.e. isBaseUri(Uri)
.
uri
- Uri to parse
buildRequestUri(String, java.util.Locale, ComponentName, String)
,
ComponentName.getPackageName()
public static ComponentName parseComponent(Uri uri)
null
if Uri does not contain agent
specification (i.e. isBaseUri(Uri)
.
uri
- Uri to parse
buildRequestUri(String, java.util.Locale, ComponentName, String)
,
parsePackageName(Uri)
public static String parseRequestTag(Uri uri)
null
if provided Uri does not denote request.
uri
- Uri to parse
parseResponseTag(Uri)
,
Request.getUri()
,
Request.getOrigin()
,
Response.getUri()
public static String parseResponseTag(Uri uri)
null
if provided Uri does not denote response.
uri
- Uri to parse
parseRequestTag(Uri)
,
Request.getOrigin()
,
Response.getUri()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |