Interface ContextValue<T>

All Known Implementing Classes:
ContextValueImpl

public interface ContextValue<T>
Holder for values that are from the GraphQLContext. Can be used if there is a need to be able to update the context value during evaluation.
  • Method Summary

    Modifier and Type Method Description
    Optional<T> asOptional()
    Get this value as an optional.
    void clear()
    Clear the value.
    T get()
    Get the current value if it is present.
    boolean isPresent()
    Get if the value is present.
    void update​(T value)
    Update the value in the context.
  • Method Details

    • isPresent

      boolean isPresent()
      Get if the value is present.
      Returns:
    • get

      T get()
      Get the current value if it is present. Will throw an error if the value is not present.
      Returns:
    • asOptional

      Optional<T> asOptional()
      Get this value as an optional.
      Returns:
    • update

      void update​(T value)
      Update the value in the context.
      Parameters:
      value -
    • clear

      void clear()
      Clear the value.