Package com.aerospike.dsl.util
Class ParsingUtils
java.lang.Object
com.aerospike.dsl.util.ParsingUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringextractFunctionName(String text) Extracts the function name from a string that may include parameters in parentheses.static IntegerextractParameter(String text) Extracts an integer parameter from a string enclosed in parentheses.static StringextractTypeFromMethod(String methodName) Extracts the type string from a method name expected to start with "as" and end with "()".static IntegersubtractNullable(Integer a, @NonNull Integer b) static StringGet the string inside the quotes.
-
Constructor Details
-
ParsingUtils
public ParsingUtils()
-
-
Method Details
-
unquote
Get the string inside the quotes.- Parameters:
str- String input- Returns:
- String inside the quotes
-
subtractNullable
- Parameters:
a- Integer, can be nullb- Integer, non-null- Returns:
- a - b if a != null, otherwise null
-
extractTypeFromMethod
Extracts the type string from a method name expected to start with "as" and end with "()".- Parameters:
methodName- The method name string- Returns:
- The extracted type string
- Throws:
DslParseException- if the method name is not in the correct format
-
extractFunctionName
Extracts the function name from a string that may include parameters in parentheses.- Parameters:
text- The input string containing the function name and potentially parameters- Returns:
- The extracted function name
-
extractParameter
Extracts an integer parameter from a string enclosed in parentheses.- Parameters:
text- The input string- Returns:
- The extracted integer parameter, or
nullif not found or invalid
-