public CreateIndexResult withState(IndexState state) {
        this.state = state.toString();
        return this;
    }
<p>
Indicates the current state of the index. You can check for changes to the state for asynchronous operations by
calling the <a>GetIndex</a> operation.
</p>
<note>
<p>
The state can remain in the <code>CREATING</code> or <code>UPDATING</code> state for several hours as Resource
Explorer discovers the information about your resources and populates the index.
</p>
</note>

@param state
       Indicates the current state of the index. You can check for changes to the state for asynchronous
       operations by calling the <a>GetIndex</a> operation.</p> <note>
       <p>
       The state can remain in the <code>CREATING</code> or <code>UPDATING</code> state for several hours as
       Resource Explorer discovers the information about your resources and populates the index.
       </p>
@return Returns a reference to this object so that method calls can be chained together.
@see IndexState
aws-java-sdk-resourceexplorer2/src/main/java/com/amazonaws/services/resourceexplorer2/model/CreateIndexResult.java