Interface Transformer<PAYLOAD,​CONTEXT>

    • Method Detail

      • transform

        Transformer<PAYLOAD,​CONTEXT> transform​(PAYLOAD payload,
                                                     Accumulator<PAYLOAD,​CONTEXT> accumulator)
        Returns transformer instance containing the payload after applying the transformation.
        Parameters:
        payload - Value to be transformed
        accumulator - Accumulator of current iteration
        Returns:
        Transformer
      • hasNext

        boolean hasNext()
        Returns whether current iteration has a successor.
        Returns:
        boolean
      • getPayloadType

        java.lang.reflect.Type getPayloadType()
        Returns Type of the payload.
        Returns:
        Type of the payload
      • getAccumulatorType

        java.lang.reflect.Type getAccumulatorType()
        Returns Type representation of the accumulator. This method is used to serialize the accumulator in Gson.
        Returns:
        Type representation of the accumulator
      • getResult

        PAYLOAD getResult()
        Returns payload after applying the transformation. The transform method should be called at least once before this method.
        Returns:
        Payload
      • getInitialAccumulator

        Accumulator<PAYLOAD,​CONTEXT> getInitialAccumulator​(PAYLOAD referenceValue)
        Returns initial accumulator used in the first transformation.
        Parameters:
        referenceValue - reference value used in the initial accumulator
        Returns:
        Initial accumulator
      • getInitialAccumulator

        default Accumulator<PAYLOAD,​CONTEXT> getInitialAccumulator()
        Returns initial accumulator used in the first transformation. The reference value is null.
        Returns:
        Initial accumulator
      • getNextAccumulator

        Accumulator<PAYLOAD,​CONTEXT> getNextAccumulator()
        Returns accumulator of next transformation.
        Returns:
        Generic accumulator