@Beta public class IntentData extends Object
| Modifier | Constructor and Description |
|---|---|
protected |
IntentData() |
|
IntentData(IntentData intentData)
Copy constructor.
|
|
IntentData(IntentData original,
List<Intent> installables)
Create a new instance based on the original instance with new installables.
|
|
IntentData(Intent intent,
IntentState state,
Timestamp version)
Creates a new intent data object.
|
|
IntentData(Intent intent,
IntentState state,
Timestamp version,
NodeId origin)
Creates a new intent data object.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
int |
errorCount()
Returns the number of times that this intent has encountered an error
during installation or withdrawal.
|
int |
hashCode() |
void |
incrementErrorCount()
Increments the error count for this intent.
|
List<Intent> |
installables()
Returns the installables associated with this intent.
|
Intent |
intent()
Returns the intent this metadata references.
|
static boolean |
isUpdateAcceptable(IntentData currentData,
IntentData newData)
Determines whether an intent data update is allowed.
|
Key |
key()
Returns the intent key.
|
NodeId |
origin()
Returns the origin node that created this intent.
|
IntentState |
request() |
void |
setErrorCount(int newCount)
Sets the error count for this intent.
|
void |
setState(IntentState newState)
Updates the state of the intent to the given new state.
|
IntentState |
state()
Returns the state of the intent.
|
String |
toString() |
Timestamp |
version()
Returns the version of the intent for this key.
|
public IntentData(Intent intent, IntentState state, Timestamp version)
intent - intent this metadata referencesstate - intent stateversion - version of the intent for this keypublic IntentData(Intent intent, IntentState state, Timestamp version, NodeId origin)
intent - intent this metadata referencesstate - intent stateversion - version of the intent for this keyorigin - ID of the node where the data was originally createdpublic IntentData(IntentData intentData)
intentData - intent data to copypublic IntentData(IntentData original, List<Intent> installables)
original - original datainstallables - new installable intents to setprotected IntentData()
public Intent intent()
public IntentState state()
public IntentState request()
public Key key()
public Timestamp version()
public NodeId origin()
public void setState(IntentState newState)
newState - new state of the intentpublic void incrementErrorCount()
public void setErrorCount(int newCount)
newCount - new countpublic int errorCount()
public List<Intent> installables()
public static boolean isUpdateAcceptable(IntentData currentData, IntentData newData)
currentData - existing intent data in the storenewData - new intent data update proposal