private Object writeReplace() throws ObjectStreamException {
    // writeReplace() should hint spotbugs that we are taking over serialization;
    // having to annotate all fields as transient is just to please it
    return new SerializationProxy<>(this);
  }
The Serialization method.

@param out the output stream
@throws IOException if IO fail
standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/properties/PropertyMap.java