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

net.roydesign.ui.SystemProperty Maven / Gradle / Ivy

Go to download

MRJ Adapter is a wrapper around built in Java Virtual Machine APIs provided by Apple.

The newest version!
package net.roydesign.ui;


public class SystemProperty {

    private String key;

    private String previousValue;

    public static SystemProperty withKey(String key) {
        SystemProperty systemProperty = new SystemProperty();
        systemProperty.key = key;
        return systemProperty;
    }

    public SystemProperty set() {
        previousValue = System.getProperty(key);
        System.setProperty(key, "true");
        return this;
    }

    public void reset() {
        if (previousValue == null) {
            System.getProperties().remove(key);
        } else {
            System.setProperty(key, previousValue);
        }
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy