Package com.consol.citrus.functions
Class FunctionLibrary
- java.lang.Object
-
- com.consol.citrus.functions.FunctionLibrary
-
public class FunctionLibrary extends Object
Library holding a set of functions. Each library defines a function prefix as namespace, so there will be no naming conflicts when using multiple libraries at a time.- Author:
- Christoph Deppisch
-
-
Constructor Summary
Constructors Constructor Description FunctionLibrary()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FunctiongetFunction(String functionName)Try to find function in library by name.Map<String,Function>getMembers()Gets the function library members.StringgetName()Get the function library name.StringgetPrefix()Get the library prefix.booleanknowsFunction(String functionName)Does this function library know a function with the given name.voidsetMembers(Map<String,Function> members)Set the function library content.voidsetName(String name)Get the name of the function library.voidsetPrefix(String prefix)Set the library prefix.
-
-
-
Method Detail
-
getFunction
public Function getFunction(String functionName) throws NoSuchFunctionException
Try to find function in library by name.- Parameters:
functionName- function name.- Returns:
- the function instance.
- Throws:
NoSuchFunctionException
-
knowsFunction
public boolean knowsFunction(String functionName)
Does this function library know a function with the given name.- Parameters:
functionName- name to search for.- Returns:
- boolean flag to mark existence.
-
setMembers
public void setMembers(Map<String,Function> members)
Set the function library content.- Parameters:
members-
-
getPrefix
public String getPrefix()
Get the library prefix.- Returns:
-
setPrefix
public void setPrefix(String prefix)
Set the library prefix.- Parameters:
prefix-
-
getName
public String getName()
Get the function library name.- Returns:
-
setName
public void setName(String name)
Get the name of the function library.- Parameters:
name-
-
-