public void write(ImageWriter writer, ImageWriterOptions options) {
        if (options.metadataVersion().isDelegationTokenSupported()) {
            for (Entry<String, DelegationTokenData> entry : tokens.entrySet()) {
                writer.write(0, entry.getValue().toRecord());
            }
        } else {
            if (!tokens.isEmpty()) {
                List<String> tokenIds = new ArrayList<>(tokens.keySet());
                String delegationTokenImageString = "DelegationTokenImage(" + String.join(", ", tokenIds) + ")";
                options.handleLoss(delegationTokenImageString);
            } 
        }
    }
Represents the DelegationToken credentials in the metadata image.

This class is thread-safe.
metadata/src/main/java/org/apache/kafka/image/DelegationTokenImage.java