Interface CompileState<S>


public interface CompileState<S>
Provides compiler state to an object.
Author:
Daniel Sagenschneider
  • Field Details

  • Method Details

    • getCompileState

      default S getCompileState()
      Obtains the compile state.
      Returns:
      Compile state.
    • compileInContext

      default <T extends Throwable> void compileInContext(S state, CompileRunnable<T> logic) throws T
      Runs the CompileRunnable with the state.
      Type Parameters:
      T - Possible failure type.
      Parameters:
      state - State.
      logic - CompileRunnable.
      Throws:
      T - Possible failure.
    • compileInContext

      default <R, T extends Throwable> R compileInContext(S state, CompileSupplier<R,T> logic) throws T
      Runs the CompileSupplier with the state.
      Type Parameters:
      R - Return type.
      T - Possible failure type.
      Parameters:
      state - State.
      logic - CompileSupplier.
      Returns:
      Return from CompileSupplier.
      Throws:
      T - Possible failure.
    • mergeCompileContext

      default S mergeCompileContext(S outer, S inner)
      Enables merging state when additional inner context is run.
      Parameters:
      outer - Outer state.
      inner - Inner state.
      Returns:
      Merged state.