@SuppressWarnings("unchecked")
  public static Map<String, String> convertToProperties(Object o) {
    if (o instanceof Map) {
      return (Map<String, String>) o;
    } else {
      List<String> listOfRawProperties = StructuredOptionsSplitter.splitEscaped(o.toString(), ',');
      return listOfRawProperties.stream()
          .map(s -> StructuredOptionsSplitter.splitEscaped(s, ':'))
          .peek(
              pair -> {
                if (pair.size() != 2) {
                  throw new IllegalArgumentException("Could not parse pair in the map " + pair);
                }
              })
          .collect(Collectors.toMap(a -> a.get(0), a -> a.get(1)));
    }
  }
Tries to convert the raw value into the provided type.

@param rawValue rawValue to convert into the provided type clazz
@param clazz clazz specifying the target type
@param <T> type of the result
@return the converted value if rawValue is of type clazz
@throws IllegalArgumentException if the rawValue cannot be converted in the specified target
    type clazz
amoro-common/src/main/java/org/apache/amoro/config/ConfigHelpers.java