public class BasicTokenEvent<T extends Token<T>> extends Status implements SingleTokenEvent<T>, MultipleTokenEvent<T>, SupplierTokenEvent<T>
Token
type.AddOnBehavior
,
Serialized FormTokenEvent.ContainerEventType, TokenEvent.TokenEventFlowStatus, TokenEvent.TokenEventType
Constructor and Description |
---|
BasicTokenEvent() |
BasicTokenEvent(BasicTokenEvent tokenEvent) |
BasicTokenEvent(String json) |
BasicTokenEvent(TokenEvent.TokenEventFlowStatus flowStatus) |
BasicTokenEvent(TokenEvent.TokenEventFlowStatus flowStatus,
Collection<T> tokens) |
BasicTokenEvent(TokenEvent.TokenEventFlowStatus flowStatus,
Supplier<Collection<T>> tokensSupplier) |
BasicTokenEvent(TokenEvent.TokenEventFlowStatus flowStatus,
T token) |
Modifier and Type | Method and Description |
---|---|
void |
addBehavior(Behavior behavior) |
void |
consumed()
Set the state to consumed.
Note there maybe other getters on the bean/state that can internally set this. |
Map<Class,Behavior> |
getBehaviors()
Optional
AddOnBehavior s for custom strategies |
Feedback |
getFeedback()
Any
SynchronousChange related Feedback |
TokenEvent.TokenEventFlowStatus |
getFlowStatus()
The
FlowStatus type of the event itself |
Consumer |
getPreEventProcess()
When tokens are assigned to this Event, then pre-action on tokens before the event is processed.
|
T |
getToken() |
Collection<T> |
getTokens() |
void |
setBehaviors(Map<Class,Behavior> behaviors)
Optional
AddOnBehavior s for custom strategies |
void |
setFeedback(Feedback feedback)
Any
SynchronousChange related Feedback |
void |
setFlowStatus(TokenEvent.TokenEventFlowStatus flowStatus)
The
FlowStatus type of the event itself |
void |
setToken(T token) |
void |
setTokens(Collection<T> tokens) |
void |
setTokens(Supplier<Collection<T>> tokensSupplier) |
String |
toString() |
boolean |
wasConsumed()
Maintain state if token(s) were accessed or not.
|
getLevel, getMessage, setLevel, setMessage
public BasicTokenEvent()
public BasicTokenEvent(BasicTokenEvent tokenEvent)
public BasicTokenEvent(String json)
public BasicTokenEvent(TokenEvent.TokenEventFlowStatus flowStatus)
public BasicTokenEvent(TokenEvent.TokenEventFlowStatus flowStatus, T token)
public BasicTokenEvent(TokenEvent.TokenEventFlowStatus flowStatus, Collection<T> tokens)
public BasicTokenEvent(TokenEvent.TokenEventFlowStatus flowStatus, Supplier<Collection<T>> tokensSupplier)
public T getToken()
getToken
in interface SingleTokenEvent<T extends Token<T>>
public void setToken(T token)
setToken
in interface SingleTokenEvent<T extends Token<T>>
public Collection<T> getTokens()
getTokens
in interface MultipleTokenEvent<T extends Token<T>>
getTokens
in interface SupplierTokenEvent<T extends Token<T>>
public void setTokens(Collection<T> tokens)
tokens
- the tokens to setpublic void setTokens(Supplier<Collection<T>> tokensSupplier)
public TokenEvent.TokenEventFlowStatus getFlowStatus()
FlowStatus
type of the event itselfgetFlowStatus
in interface FlowStatusChange
getFlowStatus
in interface TokenEvent<T extends Token<T>>
TokenEventFlowStatus
public void setFlowStatus(TokenEvent.TokenEventFlowStatus flowStatus)
FlowStatus
type of the event itselfsetFlowStatus
in interface TokenEvent<T extends Token<T>>
TokenEventFlowStatus
public boolean wasConsumed()
wasConsumed
in interface Consumable
public void consumed()
Consumable
consumed
in interface Consumable
public Feedback getFeedback()
SynchronousChange
related Feedback
getFeedback
in interface SynchronousChange<Feedback>
getFeedback
in interface TokenEvent<T extends Token<T>>
public void setFeedback(Feedback feedback)
SynchronousChange
related Feedback
setFeedback
in interface SynchronousChange<Feedback>
public Consumer getPreEventProcess()
Consumer
or Function
.
token
.getPreEventProcess
in interface TokenEvent<T extends Token<T>>
public Map<Class,Behavior> getBehaviors()
AddOnBehavior
s for custom strategiesgetBehaviors
in interface Behaviors
getBehaviors
in interface TokenEvent<T extends Token<T>>
public void setBehaviors(Map<Class,Behavior> behaviors)
AddOnBehavior
s for custom strategiessetBehaviors
in interface Behaviors
setBehaviors
in interface TokenEvent<T extends Token<T>>
public void addBehavior(Behavior behavior)
addBehavior
in interface Behaviors
addBehavior
in interface TokenEvent<T extends Token<T>>
TokenEvent.getBehaviors()
Copyright © 2018. All rights reserved.