Action.Builder

public static classAction.Builder extendsObject
Known Direct Subclasses
AssistActionBuilderConstructs an action to report completion of the Action triggered from Assistant. 

The builder forAction.

Constant Summary

String ACTIVATE_ACTIONThe act of starting or activating something.
String ADD_ACTIONThe act of editing by adding something to a collection (e.g. an item to a shopping cart or movie to a queue).
String BOOKMARK_ACTIONThe act of bookmarking something (e.g. an article or song).
String COMMENT_ACTIONThe act of commenting on something (e.g. an article or social media post).
String LIKE_ACTIONThe act of liking something (e.g. a book, song or article).
String LISTEN_ACTIONThe act of listening to something (e.g. music or a podcast).
String SEND_ACTIONThe act of sending a message.
String SHARE_ACTIONThe act of sharing something (e.g. a document or social media post)
String STATUS_TYPE_ACTIVEThe status of an active action (i.e. an action that has started but not yet completed).
String STATUS_TYPE_COMPLETEDThe status of a completed action.
String STATUS_TYPE_FAILEDThe status of a failed action.
String VIEW_ACTIONThe act of viewing something (e.g. an article or profile).
String WATCH_ACTIONThe act of watching something (e.g. a video, movie or TV show).

Public Constructor Summary

Builder(String type)
The constructor.

Public Method Summary

Action
build()
Builds the action.
Action.Builder
put(String key, double... values)
Sets one or multiple double values for a property, replacing its previous values.
Action.Builder
put(String key, boolean... values)
Sets one or multiple boolean values for a property, replacing its previous values.
Action.Builder
put(String key,Indexable... values)
Sets one or multipleIndexable values for a property, replacing its previous values.
Action.Builder
put(String key,String... values)
Sets one or multiple string values for a property, replacing its previous values.
Action.Builder
put(String key, long... values)
Sets one or multiple long values for a property, replacing its previous values.
Action.Builder
setActionStatus(String actionStatus)
Sets the status of the action.
Action.Builder
setMetadata(Action.Metadata.Builder metadataBuilder)
Sets the metadata for this action.
finalAction.Builder
setName(String name)
Sets the name of the action (e.g. Ride using Waymo LLC).
Action.Builder
setObject(String name,String url,String webUrl)
Sets the object that the action is taken on (e.g. the article being viewed, or the song being listened to).
Action.Builder
setObject(String name,String url)
Sets the object that the action is taken on (e.g. the article being viewed, or the song being listened to).
Action.Builder
setResult(Indexable... values)
Sets the result of the action.
finalAction.Builder
setUrl(String url)
Sets the URL of the action.

Inherited Method Summary

From class java.lang.Object
Object
clone()
boolean
equals(Object arg0)
void
finalize()
finalClass<?>
getClass()
int
hashCode()
final void
notify()
final void
notifyAll()
String
toString()
final void
wait(long arg0, int arg1)
final void
wait(long arg0)
final void
wait()

Constants

public static finalStringACTIVATE_ACTION

The act of starting or activating something.

Constant Value:"ActivateAction"

public static finalStringADD_ACTION

The act of editing by adding something to a collection (e.g. an item to a shopping cart or movie to a queue).

Constant Value:"AddAction"

public static finalStringBOOKMARK_ACTION

The act of bookmarking something (e.g. an article or song).

Constant Value:"BookmarkAction"

public static finalStringCOMMENT_ACTION

The act of commenting on something (e.g. an article or social media post).

Constant Value:"CommentAction"

public static finalStringLIKE_ACTION

The act of liking something (e.g. a book, song or article).

Constant Value:"LikeAction"

public static finalStringLISTEN_ACTION

The act of listening to something (e.g. music or a podcast).

Constant Value:"ListenAction"

public static finalStringSEND_ACTION

The act of sending a message.

Constant Value:"SendAction"

public static finalStringSHARE_ACTION

The act of sharing something (e.g. a document or social media post)

Constant Value:"ShareAction"

public static finalStringSTATUS_TYPE_ACTIVE

The status of an active action (i.e. an action that has started but not yet completed).

Constant Value:"//schema.org/ActiveActionStatus"

public static finalStringSTATUS_TYPE_COMPLETED

The status of a completed action.

Constant Value:"//schema.org/CompletedActionStatus"

public static finalStringSTATUS_TYPE_FAILED

The status of a failed action.

Constant Value:"//schema.org/FailedActionStatus"

public static finalStringVIEW_ACTION

The act of viewing something (e.g. an article or profile).

Constant Value:"ViewAction"

public static finalStringWATCH_ACTION

The act of watching something (e.g. a video, movie or TV show).

Constant Value:"WatchAction"

Public Constructors

publicBuilder(String type)

The constructor.

Parameters
type The Schema.org type best describing this action (use one of the constants on this class, or refer to//schema.org/Action for a list of standard action types).

Public Methods

publicActionbuild()

Builds the action.

publicAction.Builderput(String key, double... values)

Sets one or multiple double values for a property, replacing its previous values.

Parameters
keyThe property. Must not be null.
valuesThe double values of the property.

publicAction.Builderput(String key, boolean... values)

Sets one or multiple boolean values for a property, replacing its previous values.

Parameters
keyThe property. Must not be null.
valuesThe boolean values of the property.

publicAction.Builderput(String key,Indexable... values)

Sets one or multipleIndexable values for a property, replacing its previous values.

Parameters
keyThe schema.org property. Must not be null.
valuesThe values represented as anIndexable. Null values are ignored.Indexables must be constructed usingIndexable.Builder or convenience methods.

publicAction.Builderput(String key,String... values)

Sets one or multiple string values for a property, replacing its previous values.

Parameters
keyThe property. Must not be null.
valuesThe string values of the property. Null values are ignored.

publicAction.Builderput(String key, long... values)

Sets one or multiple long values for a property, replacing its previous values.

Parameters
keyThe property. Must not be null.
valuesThe long values of the property.

publicAction.BuildersetActionStatus(String actionStatus)

Sets the status of the action. Optional.

publicAction.BuildersetMetadata(Action.Metadata.Builder metadataBuilder)

Sets the metadata for this action. Optional.

public finalAction.BuildersetName(String name)

Sets the name of the action (e.g. Ride using Waymo LLC).

publicAction.BuildersetObject(String name,String url,String webUrl)

Sets the object that the action is taken on (e.g. the article being viewed, or the song being listened to).

Parameters
nameThe name of the object (e.g. the title of an article, or name of a song). Must not be null.
urlThe URL of the object (this URL needs to be handled by the app to take the user to the right place). Must be a valid URL.
webUrlThe web URL of the object, if different fromurl. Must be a valid URL.

publicAction.BuildersetObject(String name,String url)

Sets the object that the action is taken on (e.g. the article being viewed, or the song being listened to).

Parameters
nameThe name of the object (e.g. the title of an article, or name of a song). Must not be null.
urlThe URL of the object (this URL needs to be handled by the app to take the user to the right place). Must be a valid URL.

publicAction.BuildersetResult(Indexable... values)

Sets the result of the action. Optional.

Parameters
valuesResults of performing the action.

public finalAction.BuildersetUrl(String url)

Sets the URL of the action.

Must match Object URL when both are set.

Parameters
urlThe URL to start an activity to (re)perform the action. Must be a valid URL.

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2021-02-11 UTC.