All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.princexml.wrapper.CommandLine Maven / Gradle / Ivy

/*
 * Copyright (C) 2021 YesLogic Pty. Ltd.
 * All rights reserved.
 */

package com.princexml.wrapper;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;

/**
 * Command line utility class.
 */
final class CommandLine {
    static String toCommand(String key) {
        return "--" + key;
    }

    static  String toCommand(String key, T value) {
        return toCommand(key) + "=" + value;
    }

    static  String toCommand(String key, List values) {
        String csv = values
                .stream()
                .map(String::valueOf)
                .collect(Collectors.joining(","));
        return toCommand(key, csv);
    }

    static  List toCommands(String key, List values) {
        List repeatingCommands = new ArrayList<>();
        values.forEach(v -> repeatingCommands.add(toCommand(key, v)));
        return repeatingCommands;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy