# Interface DeferredValue

All Superinterfaces:
  `InternalUnsupportedTypeFactory.Marker`

Functional Interface:
  This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface DeferredValue extends InternalUnsupportedTypeFactory.Marker
A value that is not known until a preceding row of the same transaction has been executed, e.g. a generated PK propagated to a dependent PK or to a foreign key. Such a value is captured when a batch is planned and resolved lazily via `resolve(Object)` when the owning row is bound, after the rows it depends on have been executed.

Since:
  5.0

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final int`
  `MAX_NESTED_LEVEL`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Object`
  `get()`
  Returns the current value, which may itself be another `DeferredValue`.
  `static Object`
  `resolve(Object value)`
  Fully resolves a value that may be a `DeferredValue`, following nested chains all the way down.

  ### Methods inherited from interface InternalUnsupportedTypeFactory.Marker

  `errorMessage`

- ## Field Details

  - ### MAX_NESTED_LEVEL

    static final int MAX_NESTED_LEVEL
    See Also:
      - Constant Field Values

- ## Method Details

  - ### get

    Object get()
    Returns the current value, which may itself be another `DeferredValue`. Use `resolve(Object)` to collapse a full chain.

  - ### resolve

    static Object resolve(Object value)
    Fully resolves a value that may be a `DeferredValue`, following nested chains all the way down. A value that is not a `DeferredValue` is returned as is. Throws if the chain does not terminate, guarding against a value that (incorrectly) resolves to itself.