com.amazonaws.services.simpleworkflow.flow.core

## クラス Settable<V>

- java.lang.Object
- - com.amazonaws.services.simpleworkflow.flow.core.Promise<V>
  - - com.amazonaws.services.simpleworkflow.flow.core.Settable<V>

- 型パラメータ:
    `V` - The type of value accepted and returned by this Settable.Use `Void` to represent Promise that indicates completion of operation that doesn't return a value.

      public class Settable<V>
      extends Promise<V>

  It is an implementation of Promise, which exposes an additional `set(Object)` and `chain(Promise)` methods. Calling `set(Object)` puts it in ready state, with value retrievable through `get()` method. `chain(Promise)` links state of this Settable to another Promise. When another promise changes its state to ready the chained one is also becomes ready.

  Use `settable.set(null)` to set `Settable<Void>` to the ready state.

  Settable is frequently used to return data from code contained in anonymous classes. For example:

       Promise<Integer> foo() {
           final Settable<Integer> result = new Settable<Integer>();
           new TryCatch() {

               protected void doTry() throws Throwable {
                   Promise<Integer> activity1Result = activities.callActivity1();
                   result.chain(activity1Result);
               }

               protected void doCatch(Throwable e) throws Throwable {
                   Promise<Void> handled = handleFailure(e);
                   rethrow(e, handled);
               }
            };
            return result;
       }

- - ### コンストラクタの概要

    コンストラクタ
    コンストラクタと説明
    `Settable()`
    `Settable(V value)`

  - ### メソッドの概要

    メソッド
    修飾子とタイプ | メソッドと説明
    --- | ---
    `protected void` | `addCallback(java.lang.Runnable callback)` Compliant implementation should notify callbacks after promise is set to ready state.
    `void` | `chain(Promise<V> chainTo)` Used to chain this Settable with the passed in Promise.
    `V` | `get()`
    `java.lang.String` | `getDescription()`
    `boolean` | `isReady()`
    `protected void` | `removeCallback(java.lang.Runnable callback)`
    `void` | `set(V value)`
    `void` | `setDescription(java.lang.String description)`
    `java.lang.String` | `toString()`
    `void` | `unchain()` Used to unchain this Settable from the Promise object passed in last invocation of chain.

    - ### クラスから継承されたメソッド com.amazonaws.services.simpleworkflow.flow.core.Promise

      `asPromise, Void`

    - ### クラスから継承されたメソッド java.lang.Object

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

- - ### コンストラクタの詳細

    - #### Settable

          public Settable(V value)

    - #### Settable

          public Settable()

  - ### メソッドの詳細

    - #### get

          public V get()

      定義:
        `get` クラス内 `Promise<V>`
      戻り値:
        The value passed in when set() is called
      例外:
        `java.lang.IllegalStateException` - If set() is never called for this instance of Settable

    - #### isReady

          public boolean isReady()

      定義:
        `isReady` クラス内 `Promise<V>`
      戻り値:
        `true` if set() is called for this Settable

    - #### set

          public void set(V value)

      パラメータ:
        `value` - Object to return when get() is called for this Settable. Use `null` to set `Settable<Void>` to the ready state.
      例外:
        `java.lang.IllegalStateException` - if the Promise is already in ready state

    - #### chain

          public void chain(Promise<V> chainTo)

      Used to chain this Settable with the passed in Promise. This allows the Settable to be ready whenever the passed in Promise is ready and the value for the chained Promise can be retrieved by calling get() method on this Settable.
      パラメータ:
        `chainTo` - Promise object to chain this Settable to. Chaining to `null` equates calling `set(Object)` with `null` argument.
      例外:
        `java.lang.IllegalStateException` - if Settable is already in ready state or it is already chained to some other Promise
      関連項目:
        `unchain()`

    - #### unchain

          public void unchain()

      Used to unchain this Settable from the Promise object passed in last invocation of chain. There is no requirement to unchain unless there is a need to chain the Settable to another Promise. Such need usually appears when implementing recursive functions or in `TryCatchFinally.doCatch(Throwable)` blocks. It is safe to call unchain if chain is never called for this Settable.
      例外:
        `java.lang.IllegalStateException` - If the Promise it is chained to is already in the ready state

    - #### addCallback

          protected void addCallback(java.lang.Runnable callback)

      クラスからコピーされた説明: `Promise`
      Compliant implementation should notify callbacks after promise is set to ready state.
      定義:
        `addCallback` クラス内 `Promise<V>`
      パラメータ:
        `callback` - callback to notify

    - #### removeCallback

          protected void removeCallback(java.lang.Runnable callback)

      定義:
        `removeCallback` クラス内 `Promise<V>`

    - #### getDescription

          public java.lang.String getDescription()

      オーバーライド:
        `getDescription` クラス内 `Promise<V>`
      戻り値:
        human friendly description on what this promise represents. Emitted for example as part of `AsyncScope.getAsynchronousThreadDumpAsString()`

    - #### setDescription

          public void setDescription(java.lang.String description)

      パラメータ:
        `description` - human readable description of what this Promise represents.
      関連項目:
        `Promise.getDescription()`

    - #### toString

          public java.lang.String toString()

      オーバーライド:
        `toString` クラス内 `java.lang.Object`