Class ParsingUtils

java.lang.Object
com.aerospike.dsl.util.ParsingUtils

public class ParsingUtils extends Object
  • Constructor Details

    • ParsingUtils

      public ParsingUtils()
  • Method Details

    • unquote

      public static String unquote(String str)
      Get the string inside the quotes.
      Parameters:
      str - String input
      Returns:
      String inside the quotes
    • subtractNullable

      public static Integer subtractNullable(Integer a, @NonNull @NonNull Integer b)
      Parameters:
      a - Integer, can be null
      b - Integer, non-null
      Returns:
      a - b if a != null, otherwise null
    • extractTypeFromMethod

      public static String extractTypeFromMethod(String methodName)
      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

      public static String extractFunctionName(String text)
      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

      public static Integer extractParameter(String text)
      Extracts an integer parameter from a string enclosed in parentheses.
      Parameters:
      text - The input string
      Returns:
      The extracted integer parameter, or null if not found or invalid