DataExternalizer<XsdNamespaceBuilder> () { return new DataExternalizer<>() { @Override public void save(@NotNull DataOutput out, XsdNamespaceBuilder value) throws IOException { IOUtil.writeUTF(out, value.getNamespace() != null ? value.getNamespace() : NULL_STRING); IOUtil.writeUTF(out, value.getVersion() != null ? value.getVersion() : NULL_STRING); IOUtil.writeStringList(out, value.getTags()); IOUtil.writeStringList(out, value.getRootTags()); } @Override public XsdNamespaceBuilder read(@NotNull DataInput in) throws IOException { String namespace = IOUtil.readUTF(in); if (NULL_STRING.equals(namespace)) namespace = null; String version = IOUtil.readUTF(in); if (NULL_STRING.equals(version)) version = null; return new XsdNamespaceBuilder(namespace, version, IOUtil.readStringList(in), IOUtil.readStringList(in)); } }; }