public static class TriggeredCommandForm.Builder
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
TriggeredCommandForm |
build()
Build
TriggeredCommandForm instance. |
java.util.List<Action> |
getActions()
Getter of actions.
|
java.lang.String |
getDescription()
Getter of description.
|
org.json.JSONObject |
getMetadata()
Getter of meta data.
|
java.lang.String |
getSchemaName()
Getter of schema name.
|
int |
getSchemaVersion()
Getter of schema version.
|
TypedID |
getTargetID()
Getter of target thing ID.
|
java.lang.String |
getTitle()
Getter of titile.
|
static TriggeredCommandForm.Builder |
newBuilder(java.lang.String schemaName,
int schemaVersion,
java.util.List<Action> actions)
Constructs a
TriggeredCommandForm.Builder instance. |
static TriggeredCommandForm.Builder |
newBuilderFromCommand(Command command)
Constructs a
TriggeredCommandForm.Builder instance. |
TriggeredCommandForm.Builder |
setActions(java.util.List<Action> actions)
Setter of actions.
|
TriggeredCommandForm.Builder |
setDescription(java.lang.String description)
Setter of description
|
TriggeredCommandForm.Builder |
setMetadata(org.json.JSONObject metadata)
Setter of meta data.
|
TriggeredCommandForm.Builder |
setSchemaName(java.lang.String schemaName)
Setter of schema name.
|
TriggeredCommandForm.Builder |
setSchemaVersion(int schemaVersion)
Setter of schema version.
|
TriggeredCommandForm.Builder |
setTargetID(TypedID targetID)
Setter of target thing ID.
|
TriggeredCommandForm.Builder |
setTitle(java.lang.String title)
Setter of title
|
public static TriggeredCommandForm.Builder newBuilder(java.lang.String schemaName, int schemaVersion, java.util.List<Action> actions) throws java.lang.IllegalArgumentException
TriggeredCommandForm.Builder
instance.schemaName
- name of schema. Must not be null or empty string.schemaVersion
- version of schema.actions
- List of actions. Must not be null or empty.java.lang.IllegalArgumentException
- This exception is thrown if one or
more following conditions are met.
public static TriggeredCommandForm.Builder newBuilderFromCommand(Command command) throws java.lang.IllegalArgumentException
TriggeredCommandForm.Builder
instance.
This constructor copies following Command
fields:
command
- Souce of this TriggeredCommandForm.Builder
instance.java.lang.IllegalArgumentException
- if command is null.public TriggeredCommandForm.Builder setSchemaName(java.lang.String schemaName) throws java.lang.IllegalArgumentException
Schema name is requried field of command, so null and empty string is not acceptable.
schemaName
- schema name.java.lang.IllegalArgumentException
- if schemaName is invalid.public java.lang.String getSchemaName()
public TriggeredCommandForm.Builder setSchemaVersion(int schemaVersion)
schemaVersion
- schema version.public int getSchemaVersion()
public TriggeredCommandForm.Builder setActions(java.util.List<Action> actions) throws java.lang.IllegalArgumentException
List of action is required field of command, so null and empty list is not acceptable.
actions
- List of action.java.lang.IllegalArgumentException
- actions is null or empty list.public java.util.List<Action> getActions()
public TriggeredCommandForm.Builder setTargetID(TypedID targetID) throws java.lang.IllegalArgumentException
ThingIFAPI.postNewTrigger(TriggeredCommandForm,
Predicate, TriggerOptions)
and ThingIFAPI.patchTrigger(String,
TriggeredCommandForm, Predicate, TriggerOptions)
use TriggeredCommandForm.getTargetID()
to specify target of command
in trigger. If you do not set target thing ID with this method,
Default target is used. The default target is ThingIFAPI.getTarget()
.
If you create trigger which target of command is not default
target, and update trigger with TriggeredCommandForm.getTargetID()
as null, then, command target
of updated trigger is changed to default target.
targetID
- target thing ID.java.lang.IllegalArgumentException
- type of targetID is not TypedID.Types#THING
.public TypedID getTargetID()
public TriggeredCommandForm.Builder setTitle(java.lang.String title) throws java.lang.IllegalArgumentException
title
- Length of title must be equal or less than 50
characters.java.lang.IllegalArgumentException
- if title is invalid.public java.lang.String getTitle()
public TriggeredCommandForm.Builder setDescription(java.lang.String description) throws java.lang.IllegalArgumentException
description
- Length of description must be equal or less
than 200 characters.java.lang.IllegalArgumentException
- if description is invalid.public java.lang.String getDescription()
public TriggeredCommandForm.Builder setMetadata(org.json.JSONObject metadata)
metadata
- meta data of this command.public org.json.JSONObject getMetadata()
public TriggeredCommandForm build()
TriggeredCommandForm
instance.TriggeredCommandForm
instance.Copyright 2015 Kii Corporation. All rights reserved. (Last updated on 2016-10-13 08:55 UTC)