Interface ValueDecoder

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 ValueDecoder
Interface of configuration property values decoders.
Since:
1.0
Version:
1.0, 2025-05
Author:
(w) Iker Hernaez
  • Field Summary

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

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

    • DEFAULT

      static final ValueDecoder DEFAULT
      Default identity configuration property value decoder.
  • Method Details

    • decode

      String decode(String value)
      Decodes the configuration property value.
      Parameters:
      value - The configuration property value.
      Returns:
      The decoded configuration property value.
    • compose

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

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