Class JsonWriteContext.TryWrite

java.lang.Object
jadex.transformation.jsonserializer.processors.JsonWriteContext.TryWrite
Enclosing class:
JsonWriteContext

public static class JsonWriteContext.TryWrite extends Object
Try.style monad for stateful write to the write context, handling first writes specially.
  • Field Details

    • first

      protected boolean first
      First write state.
    • onlyfirst

      protected boolean onlyfirst
      Write only first attempt.
    • context

      protected JsonWriteContext context
      Wrute context.
  • Constructor Details

    • 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 Details

    • write

      public JsonWriteContext write(String value)
      Write or not depending on state.
      Parameters:
      value - Value to write.
      Returns:
      The context for convenience.