Class EnumResolver
- java.lang.Object
-
- com.blackrook.expression.resolver.EnumResolver
-
- All Implemented Interfaces:
ExpressionFunctionResolver
public class EnumResolver extends Object implements ExpressionFunctionResolver
A special kind of function resolver that wraps anEnumofExpressionFunctionType- Author:
- Matthew Tropiano
-
-
Constructor Summary
Constructors Constructor Description EnumResolver(Enum<? extends ExpressionFunctionType>... en)Creates a new resolver using a list of enum values.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontainsFunctionByName(String name)Attempts to find if this resolver has a function by its calling name.ExpressionFunctionTypegetFunctionByName(String name)Attempts to resolve a pertinent function by its calling name.
-
-
-
Constructor Detail
-
EnumResolver
@SafeVarargs public EnumResolver(Enum<? extends ExpressionFunctionType>... en)
Creates a new resolver using a list of enum values.- Parameters:
en- the list of enum values (usually Enum.values()).
-
-
Method Detail
-
getFunctionByName
public ExpressionFunctionType getFunctionByName(String name)
Description copied from interface:ExpressionFunctionResolverAttempts to resolve a pertinent function by its calling name.Names must be resolved case-insensitively!
If this returns a non-null for a function name,
ExpressionFunctionResolver.containsFunctionByName(String)must NOT returnfalseif called with that name!The same function must be returned if this is called again with the same name!
- Specified by:
getFunctionByNamein interfaceExpressionFunctionResolver- Parameters:
name- the name to resolve.- Returns:
- a corresponding function or null for no such function.
- See Also:
ExpressionFunctionResolver.containsFunctionByName(String)
-
containsFunctionByName
public boolean containsFunctionByName(String name)
Description copied from interface:ExpressionFunctionResolverAttempts to find if this resolver has a function by its calling name.Names must be resolved case-insensitively!
If this returns
truefor a function name,ExpressionFunctionResolver.getFunctionByName(String)must NOT return null if called with that name!- Specified by:
containsFunctionByNamein interfaceExpressionFunctionResolver- Parameters:
name- the name to find.- Returns:
- a corresponding function or null for no such function.
-
-