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 JsonWriteContextWrute context.protected booleanFirst write state.protected booleanWrite 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.
-