# Class SceneAction

java.lang.Object
com.codename1.home.SceneAction

public final class SceneAction extends Object

One thing a `Scene` does: set one `Trait` on one `AccessoryService` to one value.

The same shape as a `TraitWrite`, and deliberately a separate type: a write happens now and can carry a door-lock PIN, while a scene action is stored and replayed by the platform later, when this app may not be running. There is nowhere to put a credential in that story, which is why locks are generally not scriptable into scenes.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `SceneAction(String accessoryId, String serviceId, Trait trait, TraitValue value)`
  Creates a scene action.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String`
  `getAccessoryId()`
  The accessory this action acts on.
  `String`
  `getServiceId()`
  The service on that accessory.
  `Trait`
  `getTrait()`
  The trait this action sets.
  `TraitValue`
  `getValue()`
  The value it sets the trait to.
  `String`
  `toString()`
  Returns a string representation of the object.

  ### Methods inherited from class Object

  `clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### SceneAction

    public SceneAction(String accessoryId, String serviceId, Trait trait, TraitValue value)

    Creates a scene action.

    ###### Parameters

    - `accessoryId`: the accessory to act on

    - `serviceId`: the service on that accessory

    - `trait`: the trait to set

    - `value`: the value to set it to

    ###### Throws

    - `IllegalArgumentException`: when any argument is `null` or empty, or when `value`'s kind does not match the trait's

- ## Method Details

  - ### getAccessoryId

    public String getAccessoryId()

    The accessory this action acts on.

    ###### Returns

    the accessory identifier, never `null`

  - ### getServiceId

    public String getServiceId()

    The service on that accessory.

    ###### Returns

    the service identifier, never `null`

  - ### getTrait

    public Trait getTrait()

    The trait this action sets.

    ###### Returns

    the trait, never `null`

  - ### getValue

    public TraitValue getValue()

    The value it sets the trait to.

    ###### Returns

    the value, never `null`

  - ### toString

    public String toString()
    Description copied from class: `Object`
    Returns a string representation of the object. In general, the toString method returns a string that "textually represents" this object. The result should be a concise but informative representation that is easy for a person to read. It is recommended that all subclasses override this method. The toString method for class Object returns a string consisting of the name of the class of which the object is an instance, the at-sign character `@', and the unsigned hexadecimal representation of the hash code of the object. In other words, this method returns a string equal to the value of: getClass().getName() + '@' + Integer.toHexString(hashCode())
    Overrides:
      `toString` in class `Object`