Serialization.java 文件源码

java
阅读 27 收藏 0 点赞 0 评论 0

项目:PlayerVaults 作者:
@Deprecated
private static Map<String, Object> handleSerialization(Map<String, Object> map) {
    Map<String, Object> serialized = recreateMap(map);
    for (Entry<String, Object> entry : serialized.entrySet()) {
        if (entry.getValue() instanceof ConfigurationSerializable) {
            entry.setValue(serialize((ConfigurationSerializable) entry.getValue()));
        } else if (entry.getValue() instanceof Iterable<?>) {
            List<Object> newList = new ArrayList<>();
            for (Object object : ((Iterable) entry.getValue())) {
                if (object instanceof ConfigurationSerializable) {
                    object = serialize((ConfigurationSerializable) object);
                }
                newList.add(object);
            }
            entry.setValue(newList);
        } else if (entry.getValue() instanceof Map<?, ?>) {
            // unchecked cast here.  If you're serializing to a non-standard Map you deserve ClassCastExceptions
            entry.setValue(handleSerialization((Map<String, Object>) entry.getValue()));
        }
    }
    return serialized;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号