DataExternalizer<Set<SchemaTypeInfo>> () { return new DataExternalizer<>() { @Override public void save(@NotNull DataOutput out, Set<SchemaTypeInfo> value) throws IOException { DataInputOutputUtil.writeINT(out, value.size()); for (SchemaTypeInfo key : value) { IOUtil.writeUTF(out, key.getNamespaceUri()); IOUtil.writeUTF(out, key.getTagName()); out.writeBoolean(key.isIsTypeName()); } } @Override public Set<SchemaTypeInfo> read(@NotNull DataInput in) throws IOException { final Set<SchemaTypeInfo> set = new HashSet<>(); final int size = DataInputOutputUtil.readINT(in); for (int i = 0; i < size; i++) { final String nsUri = IOUtil.readUTF(in); final String tagName = IOUtil.readUTF(in); final boolean isType = in.readBoolean(); set.add(new SchemaTypeInfo(tagName, isType, nsUri)); } return set; } }; }