Package org.eclipse.handly.context

# 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 Summary

  Modifier and Type
  Method
  Description
  `Context`
  `to(T value)`
  Associates the given value with a key in this context.
  `Context`
  `toSupplier(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 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