Class JsonWriteContext.TryWrite
- java.lang.Object
-
- jadex.transformation.jsonserializer.processors.JsonWriteContext.TryWrite
-
- Enclosing class:
- JsonWriteContext
public static class JsonWriteContext.TryWrite extends java.lang.Object
Try.style monad for stateful write to the write context, handling first writes specially.
-
-
Field Summary
Fields Modifier and Type Field Description protected JsonWriteContext
context
Wrute context.protected boolean
first
First write state.protected boolean
onlyfirst
Write only first attempt.
-
Constructor Summary
Constructors Constructor Description TryWrite(JsonWriteContext context)
Initialized the monad.TryWrite(JsonWriteContext context, boolean onlyfirst)
Initialized the monad.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JsonWriteContext
write(java.lang.String value)
Write or not depending on state.
-
-
-
Field Detail
-
first
protected boolean first
First write state.
-
onlyfirst
protected boolean onlyfirst
Write only first attempt.
-
context
protected JsonWriteContext context
Wrute context.
-
-
Constructor Detail
-
TryWrite
public TryWrite(JsonWriteContext context)
Initialized the monad.- Parameters:
context
- Write context.
-
TryWrite
public TryWrite(JsonWriteContext context, boolean onlyfirst)
Initialized the monad.- Parameters:
context
- Write context.onlyfirst
- Write only on first write instead of every write except the first.
-
-
Method Detail
-
write
public JsonWriteContext write(java.lang.String value)
Write or not depending on state.- Parameters:
value
- Value to write.- Returns:
- The context for convenience.
-
-