public class State extends AbstractNode
| Modifier and Type | Class and Description |
|---|---|
static class |
State.StateBuilder
A basic State builder
|
id, name| Constructor and Description |
|---|
State(String name)
Constructor with node name
|
| Modifier and Type | Method and Description |
|---|---|
State |
addProperty(@NonNull String key,
@NonNull String value)
Adds the property with the given key and value.
|
boolean |
equals(Object o) |
static State.StateBuilder |
from(String name)
Static factory method to create the State
|
Optional<String> |
getProperty(@NonNull String key)
Retrieves the property identified by the given key
or null if not found
|
int |
hashCode() |
boolean |
hasProperties()
Checks whether the state has properties or not
|
boolean |
hasProperty(@NonNull String key)
Checks whether the state contains the given property.
|
AbstractNode |
merge(AbstractNode state)
Merges the information of the given state
into the current instance.
|
static State |
named(String name)
Static factory method to create the State with name.
|
State |
removeProperty(@NonNull String key)
Removes the property identified by the given key
or discard the operation silently if not found.
|
String |
toString() |
getId, getName, isFinal, setFinalpublic State(String name)
name - the name of the nodepublic static State.StateBuilder from(String name)
name - the name of the statepublic static State named(String name)
name - the name of the statepublic State addProperty(@NonNull @NonNull String key, @NonNull @NonNull String value)
key - the name of the property to add.value - the property valuepublic State removeProperty(@NonNull @NonNull String key)
key - the name of the property to removepublic Optional<String> getProperty(@NonNull @NonNull String key)
key - the name of the property to removepublic boolean hasProperty(@NonNull
@NonNull String key)
key - the key of the propertypublic boolean hasProperties()
public AbstractNode merge(AbstractNode state)
merge in interface Mergeable<AbstractNode>merge in class AbstractNodestate - the state to mergepublic boolean equals(Object o)
equals in class AbstractNodepublic int hashCode()
hashCode in class AbstractNodeCopyright © 2019 state-machine. All rights reserved.