Class ResolverBundle

java.lang.Object
java.util.AbstractMap<String, Function<com.github.dakusui.actionunit.core.Context, Object>>
java.util.HashMap<String, Function<com.github.dakusui.actionunit.core.Context, Object>>
jp.co.moneyforward.autotest.framework.action.ResolverBundle
All Implemented Interfaces:
Serializable, Cloneable, Map<String, Function<com.github.dakusui.actionunit.core.Context, Object>>

public class ResolverBundle extends HashMap<String, Function<com.github.dakusui.actionunit.core.Context, Object>>

A bundle of variable resolvers.

A variable resolver figures out a value of a variable specified by a variable name. This class bundles a set of such resolvers and associated each resolver with a variable name which the resolver should figure out the value.

See Also:
  • Constructor Details

    • ResolverBundle

      public ResolverBundle(Map<String, Function<com.github.dakusui.actionunit.core.Context, Object>> resolvers)
      Creates an instance of this class.
      Parameters:
      resolvers - A map of resolvers from variable names to resolvers.
    • ResolverBundle

      public ResolverBundle(List<Resolver> resolvers)
      Creates an instance of this class.
      Parameters:
      resolvers - A list of resolvers from which an object of this class will be created.
  • Method Details

    • resolverBundleFor

      public static ResolverBundle resolverBundleFor(Scene scene, String variableStoreName)

      Returns a resolver bundle object which figures out both input and output variable values for a given Scene. The variables are looked up from a variable store specified by the argument variableStoreName.

      For each input or output variable, a resolver will be created, and it will be an element of the returned bundle.

      Parameters:
      scene - A scene for which resolver bundle is created.
      variableStoreName - A name of variable store, where variable values are looked up.
      Returns:
      A new resolver bundle.
    • resolverBundleFromDependenciesOf

      public static ResolverBundle resolverBundleFromDependenciesOf(Method targetMethod, Class<?> accessModelClass)
      Returns a resolver bundle which is necessary for creating a new SceneCall call from a Scene defined by targetMethod.
      Parameters:
      targetMethod - A method which creates a Scene.
      accessModelClass - A class to which targetMethod belongs and from which dependencies of target method are searched.
      Returns:
      A resolver bundle for a Scene created by targetMethod.