Interface ConfigBinding<T>

Type Parameters:
T - immutable configuration value type
All Superinterfaces:
AutoCloseable, Supplier<T>

public interface ConfigBinding<T> extends Supplier<T>, AutoCloseable
Stable typed configuration provider. Close detaches its registration without closing its values. Implementations are thread-safe; use snapshot when value and version must be read together.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Detaches this registration idempotently; subsequent reads fail.
    default T
    get()
    Returns the value from one atomic snapshot.
    Reads value and version atomically.
  • Method Details

    • snapshot

      Reads value and version atomically.
      Returns:
      one immutable value/version pair
      Throws:
      IllegalStateException - if this binding or its owner has closed
    • get

      default T get()
      Returns the value from one atomic snapshot.
      Specified by:
      get in interface Supplier<T>
      Returns:
      current value, possibly null for an absent optional scalar
      Throws:
      IllegalStateException - if closed
    • close

      void close()
      Detaches this registration idempotently; subsequent reads fail.
      Specified by:
      close in interface AutoCloseable