Interface ValueEncoder

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

@API(status=STABLE, since="1.0") @FunctionalInterface public interface ValueEncoder
Interface of configuration property values encoders.
Since:
1.0
Version:
1.0, 2025-05
Author:
(w) Iker Hernaez
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final ValueEncoder
    Default identity configuration property value encoder.
  • Method Summary

    Modifier and Type
    Method
    Description
    default @NotNull ValueEncoder
    andThen(@NotNull ValueEncoder after)
    Returns a composed encoder that first applies this encoder to its input, and then applies the after encoder to the result.
    default @NotNull ValueEncoder
    compose(@NotNull ValueEncoder before)
    Returns a composed encoder that first applies the before encoder to its input, and then applies this encoder to the result.
    encode(String value)
    Encodes the configuration property value.
  • Field Details

    • DEFAULT

      static final ValueEncoder DEFAULT
      Default identity configuration property value encoder.
  • Method Details

    • encode

      String encode(String value)
      Encodes the configuration property value.
      Parameters:
      value - The configuration property value.
      Returns:
      The encoded configuration property value.
    • compose

      @NotNull default @NotNull ValueEncoder compose(@NotNull @NotNull ValueEncoder before)
      Returns a composed encoder that first applies the before encoder to its input, and then applies this encoder to the result. If evaluation of either encoder throws an exception, it is relayed to the caller of the composed encoder.
      Parameters:
      before - The encoder to apply before this encoder is applied.
      Returns:
      A composed encoder that first applies the before encoder and then applies this encoder.
      Throws:
      NullPointerException - If before is null;
      See Also:
    • andThen

      @NotNull default @NotNull ValueEncoder andThen(@NotNull @NotNull ValueEncoder after)
      Returns a composed encoder that first applies this encoder to its input, and then applies the after encoder to the result. If evaluation of either encoder throws an exception, it is relayed to the caller of the composed encoder.
      Parameters:
      after - The encoder to apply after this encoder is applied.
      Returns:
      A composed encoder that first applies this encoder and then applies the after encoder.
      Throws:
      NullPointerException - If after is null.
      See Also: