Class Context.BindingBuilder<T>

  • Type Parameters:
    T - the type of value
    Enclosing class:
    Context

    public class Context.BindingBuilder<T>
    extends java.lang.Object
    Associates a value with a key in this context.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Context to​(T value)
      Associates the given value with a key in this context.
      Context toSupplier​(java.util.function.Supplier<? extends T> supplier)
      Associates the given supplier with a key in this context.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • to

        public Context to​(T value)
        Associates the given value with a key in this context.
        Parameters:
        value - may be null
        Returns:
        this context
      • toSupplier

        public Context toSupplier​(java.util.function.Supplier<? extends T> supplier)
        Associates the given supplier with a key in this context. When a value is requested for the key, the context will invoke the supplier to obtain the value.
        Parameters:
        supplier - not null
        Returns:
        this context