Class Context.BindingBuilder<T>

java.lang.Object
org.eclipse.handly.context.Context.BindingBuilder<T>
Type Parameters:
T - the type of value
Enclosing class:
Context

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

    • 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(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