📄 immutabletypesmapper.java
字号:
package com.thoughtworks.xstream.mapper;import com.thoughtworks.xstream.alias.ClassMapper;import java.util.Collections;import java.util.HashSet;import java.util.Set;/** * Mapper that specifies which types are basic immutable types. Types that are marked as immutable will be written * multiple times in the serialization stream without using references. * * @author Joe Walnes */public class ImmutableTypesMapper extends MapperWrapper { private final Set immutableTypes = Collections.synchronizedSet(new HashSet()); public ImmutableTypesMapper(ClassMapper wrapped) { super(wrapped); } public void addImmutableType(Class type) { immutableTypes.add(type); } public boolean isImmutableValueType(Class type) { if (immutableTypes.contains(type)) { return true; } else { return super.isImmutableValueType(type); } }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -