protected List<String> getCommandMetadataSegments(Metadata metadata) {
        List<String> commandMetadataSegments = new ArrayList<>();
        if (metadata == null || metadata.names() == null) {
            return commandMetadataSegments;
        }
        for (String metadataName : metadata.names()) {
            for (Property property : getMetadataCommandArguments().keySet()) {
                if (metadataName.equals(property.getName())) {
                    String[] metadataCommandArguments = getMetadataCommandArguments().get(property);
                    if (metadataCommandArguments != null) {
                        for (String metadataCommandArgument : metadataCommandArguments) {
                            if (metadata.isMultiValued(metadataName)) {
                                for (String metadataValue : metadata.getValues(metadataName)) {
                                    String assignmentValue = metadataValue;
                                    if (quoteAssignmentValues) {
                                        assignmentValue = "'" + assignmentValue + "'";
                                    }
                                    commandMetadataSegments
                                            .add(metadataCommandArgument + commandAppendOperator +
                                                    assignmentValue);
                                }
                            } else {
                                String assignmentValue = metadata.get(metadataName);
                                if (quoteAssignmentValues) {
                                    assignmentValue = "'" + assignmentValue + "'";
                                }
                                commandMetadataSegments
                                        .add(metadataCommandArgument + commandAssignmentOperator +
                                                assignmentValue);
                            }
                        }
                    }
                }
            }
        }
        return commandMetadataSegments;
    }
Constructs a collection of command line arguments responsible for setting
individual metadata fields based on the given <code>metadata</code>.

@param metadata the metadata to embed
@return the metadata-related command line arguments
tika-core/src/main/java/org/apache/tika/embedder/ExternalEmbedder.java