package com.oguerreiro.resilient.expression;

import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.Map;

public class ExpressionContext {
  private Map<String, Class> classInputs = new HashMap<>();
  private Map<String, Object> valueInputs = new HashMap<>();

  private Map<String, Class> classImports = new HashMap<>();
  private Map<String, Method> methodImports = new HashMap<>();

  private ExpressionFunctions expressionFunctions;

  public void setExpressionFunctions(ExpressionFunctions expressionFunctions) {
    this.expressionFunctions = expressionFunctions;
  }

  public ExpressionFunctions getExpressionFunctions() {
    return this.expressionFunctions;
  }

  public void addInput(String name, Class clazz, Object value) {
    this.classInputs.put(name, clazz);
    this.valueInputs.put(name, value);
  }

  public void addImport(String name, Class clazz) {
    this.classImports.put(name, clazz);
  }

  public void addImport(String name, Method method) {
    this.methodImports.put(name, method);
  }

  public Map<String, Class> getClassInputs() {
    return this.classInputs;
  }

  public Map<String, Object> getValueInputs() {
    return this.valueInputs;
  }

  public Map<String, Class> getClassImports() {
    return this.classImports;
  }

  public Map<String, Method> getMethodImports() {
    return this.methodImports;
  }
}
