Uses of Class
org.drasyl.node.behaviour.Behavior.BehaviorBuilder
-
Uses of Behavior.BehaviorBuilder in org.drasyl.node.behaviour
Modifier and TypeMethodDescriptionBehavior.BehaviorBuilder.messageAdapter
(Class<M> messageType, BiFunction<DrasylAddress, M, Object> adapter) Add a new case to the event handling matching events of typeMessageEvent
withMessageEvent.getPayload()
matchingmessageType
.Behavior.BehaviorBuilder.messageAdapter
(Class<M> messageType, Function<M, Object> adapter) Add a new case to the event handling matching events of typeMessageEvent
withMessageEvent.getPayload()
matchingmessageType
.protected Behavior.BehaviorBuilder
BehavioralDrasylNode.newBehaviorBuilder()
Creates a newBehavior.BehaviorBuilder
to build a newBehavior
for inbound message/event handling.Behavior.BehaviorBuilder.onAnyEvent
(Function<Event, Behavior> handler) Adds a new case to the event handling matching any event.Behavior.BehaviorBuilder.onAnyMessage
(BiFunction<DrasylAddress, M, Behavior> handler) Add a new case to the event handling matching anyMessageEvent
.<M extends Event>
Behavior.BehaviorBuilderAdds a new case to the event handling.<M extends Event>
Behavior.BehaviorBuilderAdds a new predicated case to the event handling.<M extends Event>
Behavior.BehaviorBuilderBehavior.BehaviorBuilder.onEventEquals
(M event, Supplier<Behavior> handler) Add a new case to the event handling matching equal events.Behavior.BehaviorBuilder.onMessage
(Class<M> messageType, BiFunction<DrasylAddress, M, Behavior> handler) Add a new case to the event handling matching events of typeMessageEvent
withMessageEvent.getPayload()
matchingmessageType
.Behavior.BehaviorBuilder.onMessage
(Class<M> messageType, BiPredicate<DrasylAddress, M> test, BiFunction<DrasylAddress, M, Behavior> handler) Add a new predicated case to the event handling matching events of typeMessageEvent
withMessageEvent.getPayload()
matchingmessageType
.Behavior.BehaviorBuilder.onMessageEquals
(DrasylAddress sender, M payload, Supplier<Behavior> handler) Add a new case to the event handling matching events of typeMessageEvent
with equalMessageEvent.getPayload()
.static Behavior.BehaviorBuilder
Behaviors.receive()
Creates a newBehavior.BehaviorBuilder
to build a newBehavior
for inbound message/event handling.