public static byte[] toJson(OsVersionChange change) {
        var slime = new Slime();
        var object = slime.setObject();
        var targetsObject = object.setArray(TARGETS_FIELD);
        change.targets().forEach((nodeType, target) -> {
            var targetObject = targetsObject.addObject();
            targetObject.setString(NODE_TYPE_FIELD, NodeSerializer.toString(nodeType));
            targetObject.setString(VERSION_FIELD, target.version().toFullString());
        });
        try {
            return SlimeUtils.toJsonBytes(slime);
        } catch (IOException e) {
            throw new UncheckedIOException(e);
        }
    }
Serializer for {@link OsVersionChange}.

@author mpolden
node-repository/src/main/java/com/yahoo/vespa/hosted/provision/persistence/OsVersionChangeSerializer.java