Class ModifyResource

  • All Implemented Interfaces:
    io.wcm.caravan.pipeline.JsonPipelineAction

    @ConsumerType
    public abstract class ModifyResource
    extends Object
    implements io.wcm.caravan.pipeline.JsonPipelineAction
    An action that can take any JSON object as input (already HAL or not), sets the specified self-link and allows arbitrary manipulation of the output HalResource by implementing the build function.
    • Constructor Detail

      • ModifyResource

        public ModifyResource​(String selfHref)
        Parameters:
        selfHref - New self HREF
    • Method Detail

      • getId

        public String getId()
        Specified by:
        getId in interface io.wcm.caravan.pipeline.JsonPipelineAction
      • execute

        public final rx.Observable<io.wcm.caravan.pipeline.JsonPipelineOutput> execute​(io.wcm.caravan.pipeline.JsonPipelineOutput previousStepOutput,
                                                                                       io.wcm.caravan.pipeline.JsonPipelineContext pipelineContext)
        Specified by:
        execute in interface io.wcm.caravan.pipeline.JsonPipelineAction
      • modify

        public abstract void modify​(io.wcm.caravan.hal.resource.HalResource output)
        Parameters:
        output - a HalResource with the state of the previous pipeline output and a self link, that you can modify to fine-tune your output