Class Capitalize
- java.lang.Object
-
- com.aquima.interactions.expressions.functions.str.Capitalize
-
- All Implemented Interfaces:
IFunction
,Serializable
public class Capitalize extends Object implements IFunction
This function capitalizes an input string and optionally lowers the rest of the characters- Since:
- 9.6
- Author:
- g.graat
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Capitalize()
Capitalize(boolean lowerTheRest)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static String
capitalize(String input, boolean lowerTheRest)
Capitalizes the first character of a String and lowercases the other characters if askedType
determineResultType(ISemanticNode... arguments)
This method is used to determine the result type of the function using the type information of the parameters that will be passed to the function.IValue
evaluate(IArgumentList arguments)
This method should execute the function using the supplied arguments.IArgumentType[]
getArguments()
This method returns an array containing the definitions of the arguments the function expects.String
getName()
This method returns the name of the function.boolean
isDeprecated()
This method returns a boolean indicating that the function is deprecated and should no longer be used.
-
-
-
Method Detail
-
getArguments
public IArgumentType[] getArguments()
Description copied from interface:IFunction
This method returns an array containing the definitions of the arguments the function expects. When the function does not accept any arguments at all, an empty array should be returned.- Specified by:
getArguments
in interfaceIFunction
- Returns:
- Array containing the definitions of the parameters.
-
evaluate
public IValue evaluate(IArgumentList arguments)
Description copied from interface:IFunction
This method should execute the function using the supplied arguments.
-
getName
public String getName()
Description copied from interface:IFunction
This method returns the name of the function.
-
determineResultType
public Type determineResultType(ISemanticNode... arguments)
Description copied from interface:IFunction
This method is used to determine the result type of the function using the type information of the parameters that will be passed to the function.- Specified by:
determineResultType
in interfaceIFunction
- Parameters:
arguments
- The type information of the parameters.- Returns:
- The result type of the function.
-
isDeprecated
public boolean isDeprecated()
Description copied from interface:IFunction
This method returns a boolean indicating that the function is deprecated and should no longer be used. Functions that are not deprecated should return the value false.- Specified by:
isDeprecated
in interfaceIFunction
- Returns:
- A message indicating that the function is deprecated.
-
capitalize
public static String capitalize(String input, boolean lowerTheRest)
Capitalizes the first character of a String and lowercases the other characters if asked- Parameters:
input
- String to be capitalizedlowerTheRest
- indicates if the other characters need to be lowercased or not- Returns:
- capitalized String
-
-