Interface CoercionOptimizer

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface CoercionOptimizer
Implements the optimization of Coercion.
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    optimize(Writer out, Encoder encoder)
    Unwraps a writer to expose any wrapped writer.
  • Method Details

    • optimize

      Writer optimize(Writer out, Encoder encoder)
      Unwraps a writer to expose any wrapped writer. The wrapped writer is only returned when it is write-through, meaning the wrapper doesn't modify the data written, and writes to the wrapped writer immediately (no buffering).
      Parameters:
      out - the writer to try unwrapping
      encoder - the encoder being used or null for none
      Returns:
      The functionally equivalent, but more efficient/direct, writer or out when nothing to unwrap