DataExternalizer<ConfigValue> () { return new DataExternalizer<>() { @Override public void save(@NotNull DataOutput out, ConfigValue configValue) throws IOException { var isNotNullValue = configValue.getValue() != null; out.writeBoolean(isNotNullValue); if (isNotNullValue) { EnumeratorStringDescriptor.INSTANCE.save(out, configValue.getValue()); } out.writeBoolean(configValue.isStopBubbling()); } @Override public ConfigValue read(@NotNull DataInput in) throws IOException { var isNotNullValue = in.readBoolean(); return new ConfigValue(isNotNullValue ? EnumeratorStringDescriptor.INSTANCE.read(in) : null, in.readBoolean()); } }; }