@Override
  public String toString() {
    StringBuilder buf = new StringBuilder();
    buf.append(size());
    buf.append(':');
    if (size() > 0) {
      for (Map.Entry<String, String> entry : entrySet()) {
        // Append the key String to the output StringBuilder.
        // Note that null is saved as -1 in length, and that empty String as 0.
        int length = (entry.getKey() == null) ? -1 : entry.getKey().length();
        buf.append(length);
        buf.append(':');
        if (length > 0) buf.append(entry.getKey());

        // Append the value String to the output StringBuilder.
        // Note that null is saved as -1 in length, and that empty String as 0.
        length = (entry.getValue() == null) ? -1 : entry.getValue().length();
        buf.append(length);
        buf.append(':');
        if (length > 0) {
          buf.append(entry.getValue());
        }
      }
    }
    return buf.toString();
  }
A utility class that can convert a HashMap of Properties into a colon separated string,
and can take the same format of string and convert it to a HashMap of Properties.
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/utils/StringableMap.java