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

dev.gradleplugins.runnerkit.providers.EnvironmentVariablesProvider Maven / Gradle / Ivy

There is a newer version: 0.0.148
Show newest version
package dev.gradleplugins.runnerkit.providers;

import lombok.val;

import java.util.HashMap;
import java.util.Map;

import static java.util.Collections.unmodifiableMap;

public final class EnvironmentVariablesProvider extends AbstractGradleExecutionProvider> {

    public static EnvironmentVariablesProvider inherited() {
        return noValue(EnvironmentVariablesProvider.class);
    }

    public static EnvironmentVariablesProvider of(Map environmentVariables) {
        return fixed(EnvironmentVariablesProvider.class, environmentVariables);
    }

    public EnvironmentVariablesProvider plus(Map environmentVariables) {
        val values = new HashMap();
        if (isPresent()) {
            values.putAll(get());
        } else {
            values.putAll(System.getenv());
        }
        values.putAll(environmentVariables);
        return fixed(EnvironmentVariablesProvider.class, unmodifiableMap(values));
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy