Class EvaluationContext

    • Method Detail

      • empty

        public static EvaluationContext empty()
        Get an empty evaluation context.
        Returns:
        an evaluation context with no bindings
      • forBinding

        @Nonnull
        public static EvaluationContext forBinding​(@Nonnull
                                                   String bindingName,
                                                   @Nullable
                                                   Object value)
        Create a new EvaluationContext with a single binding.
        Parameters:
        bindingName - the binding name to add
        value - the value to bind the name to
        Returns:
        a new EvaluationContext with the new binding
      • getBindings

        @Nonnull
        public Bindings getBindings()
        Retrieve the mapping from parameter names to values associated with this context.
        Returns:
        a mapping from parameter names to to values
      • getBinding

        @Nullable
        public Object getBinding​(@Nonnull
                                 String name)
        Get the value bound to a single parameter.
        Parameters:
        name - the name of the parameter to retrieve the binding of
        Returns:
        the value bound to the given parameter
        See Also:
        Bindings.get(String)
      • getBinding

        public Object getBinding​(@Nonnull
                                 CorrelationIdentifier alias)
        Get the value bound to a single parameter.
        Parameters:
        alias - the correlation identifier
        Returns:
        the value bound to the given parameter
      • childBuilder

        @Nonnull
        public EvaluationContextBuilder childBuilder()
        Construct a builder from this context. This allows the user to create a new EvaluationContext that has all of the same data as the current context except for a few modifications expressed as mutations made to the builder.
        Returns:
        a builder for this class based on this instance
      • newBuilder

        @Nonnull
        public static EvaluationContextBuilder newBuilder()
        Construct a new builder from this context.
        Returns:
        a builder for this class based on this instance
      • withBinding

        @Nonnull
        public EvaluationContext withBinding​(@Nonnull
                                             String bindingName,
                                             @Nullable
                                             Object value)
        Create a new EvaluationContext with an additional binding. The returned context will have all of the same state as the current context included all bindings except that it will bind an additional parameter to an additional value.
        Parameters:
        bindingName - the binding name to add
        value - the value to bind the name to
        Returns:
        a new EvaluationContext with the new binding
      • withBinding

        public EvaluationContext withBinding​(@Nonnull
                                             CorrelationIdentifier alias,
                                             @Nullable
                                             Object value)
        Create a new EvaluationContext with an additional binding. The returned context will have all of the same state as the current context included all bindings except that it will bind an additional parameter to an additional value.
        Parameters:
        alias - the alias determining the binding name to add
        value - the value to bind the name to
        Returns:
        a new EvaluationContext with the new binding