action/library/src/main/java/io/knotx/fragments/action/library/InlinePayloadActionFactory.java
/**
   * Creates Inline Payload Action that puts JsonObject / JsonArray to Fragment payload with alias
   * key.
   *
   * @param alias - action alias
   * @param config - JSON configuration
   * @param vertx - vertx instance
   * @param doAction - <pre>null</pre> value expected
   */
Creates Inline Payload Action that puts JsonObject / JsonArray to Fragment payload with alias
key.

@param alias - action alias
@param config - JSON configuration
@param vertx - vertx instance
@param doAction - null value expected
Creates Inline Payload Action that puts JsonObject / JsonArray to Fragment payload with alias key . @param alias - action alias @param config - JSON configuration @param vertx - vertx instance @param doAction - null value expected
@Override
  public Action create(String alias, JsonObject config, Vertx vertx, Action doAction) {
    checkArgument(!config.containsKey(PAYLOAD_KEY),
                  () -> new ActionConfigurationException(alias, "Inline Payload Action requires payload parameter"));
    checkArgument(doAction != null,
                  () -> new ActionConfigurationException(alias, "Inline Payload Action does not support doAction"));
    ActionLogLevel logLevel = ActionLogLevel.fromConfig(config, ActionLogLevel.ERROR);
    String key = config.getString(ALIAS_KEY, alias);
    Object value = config.getMap().get(PAYLOAD_KEY);
    return (SyncAction) fragmentContext -> {
      ActionLogger actionLogger = ActionLogger.create(alias, logLevel);
      fragmentContext.getFragment().appendPayload(key, value);
      logSubstitution(actionLogger, key, value);
      return success(fragmentContext.getFragment(), actionLogger.toLog().toJson());
    };
  }
@ Override public Action create ( String alias , JsonObject config , Vertx vertx , Action doAction ) { checkArgument ( ! config . containsKey ( PAYLOAD_KEY ) , ( ) -> new ActionConfigurationException ( alias , "Inline Payload Action requires payload parameter" ) ) ; checkArgument ( doAction != null , ( ) -> new ActionConfigurationException ( alias , "Inline Payload Action does not support doAction" ) ) ; ActionLogLevel logLevel = ActionLogLevel . fromConfig ( config , ActionLogLevel . ERROR ) ; String key = config . getString ( ALIAS_KEY , alias ) ; Object value = config . getMap ( ) . get ( PAYLOAD_KEY ) ; return ( SyncAction ) fragmentContext -> { ActionLogger actionLogger = ActionLogger . create ( alias , logLevel ) ; fragmentContext . getFragment ( ) . appendPayload ( key , value ) ; logSubstitution ( actionLogger , key , value ) ; return success ( fragmentContext . getFragment ( ) , actionLogger . toLog ( ) . toJson ( ) ) ; } ; }
Creates Inline Payload Action that puts JsonObject / JsonArray to Fragment payload with alias
 key.
Creates Inline Payload Action that puts JsonObject / JsonArray to Fragment payload with alias key .