static Slime encodeRequest(ConfigKey<?> key,
                               String hostname,
                               DefContent defSchema,
                               PayloadChecksums payloadChecksums,
                               long generation,
                               long timeout,
                               Trace trace,
                               long protocolVersion,
                               CompressionType compressionType,
                               Optional<VespaVersion> vespaVersion) {
        Slime data = new Slime();
        Cursor request = data.setObject();
        request.setLong(REQUEST_VERSION, protocolVersion);
        request.setString(REQUEST_DEF_NAME, key.getName());
        request.setString(REQUEST_DEF_NAMESPACE, key.getNamespace());
        request.setString(REQUEST_DEF_MD5, ConfigUtils.getDefMd5(defSchema.asList()));
        request.setString(REQUEST_CLIENT_CONFIGID, key.getConfigId());
        request.setString(REQUEST_CLIENT_HOSTNAME, hostname);
        defSchema.serialize(request.setArray(REQUEST_DEF_CONTENT));
        if (payloadChecksums.getForType(XXHASH64) != null)
            request.setString(REQUEST_CONFIG_XXHASH64, payloadChecksums.getForType(XXHASH64).asString());
        if (payloadChecksums.getForType(MD5) != null)
            request.setString(REQUEST_CONFIG_MD5, payloadChecksums.getForType(MD5).asString());
        request.setLong(REQUEST_CURRENT_GENERATION, generation);
        request.setLong(REQUEST_TIMEOUT, timeout);
        request.setString(REQUEST_COMPRESSION_TYPE, compressionType.name());
        vespaVersion.ifPresent(version -> request.setString(REQUEST_VESPA_VERSION, version.toString()));
        trace.serialize(request.setObject(REQUEST_TRACE));
        return data;
    }
Contains slime request data objects. Provides methods for reading various fields from slime request data.
All data is read lazily.

@author Ulf Lilleengen
config/src/main/java/com/yahoo/vespa/config/protocol/SlimeRequestData.java