Class JsonWriteContext.TryWrite
java.lang.Object
jadex.transformation.jsonserializer.processors.JsonWriteContext.TryWrite
- Enclosing class:
JsonWriteContext
Try.style monad for stateful write to the write context, handling first writes specially.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected JsonWriteContext
Wrute context.protected boolean
First write state.protected boolean
Write only first attempt. -
Constructor Summary
ConstructorsConstructorDescriptionTryWrite
(JsonWriteContext context) Initialized the monad.TryWrite
(JsonWriteContext context, boolean onlyfirst) Initialized the monad. -
Method Summary
Modifier and TypeMethodDescriptionWrite or not depending on state.
-
Field Details
-
first
protected boolean firstFirst write state. -
onlyfirst
protected boolean onlyfirstWrite only first attempt. -
context
Wrute context.
-
-
Constructor Details
-
TryWrite
Initialized the monad.- Parameters:
context
- Write context.
-
TryWrite
Initialized the monad.- Parameters:
context
- Write context.onlyfirst
- Write only on first write instead of every write except the first.
-
-
Method Details
-
write
Write or not depending on state.- Parameters:
value
- Value to write.- Returns:
- The context for convenience.
-