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

brooklyn.util.internal.StringSystemProperty Maven / Gradle / Ivy

Go to download

Utility classes and methods developed for Brooklyn but not dependendent on Brooklyn or much else

There is a newer version: 0.7.0-M1
Show newest version
package brooklyn.util.internal;

public class StringSystemProperty {

    // TODO replace usages of this and related items with ConfigKeys
    
    public StringSystemProperty(String name) {
        this.propertyName = name;
    }

    private final String propertyName;

    public String getPropertyName() {
        return propertyName;
    }

    public boolean isAvailable() {
        String property = System.getProperty(getPropertyName());
        return property!=null;
    }
    public boolean isNonEmpty() {
        String property = System.getProperty(getPropertyName());
        return property!=null && !property.equals("");
    }
    public String getValue() {
        return System.getProperty(getPropertyName());
    }
    @Override
    public String toString() {
        return getPropertyName()+(isAvailable()?"="+getValue():"(unset)");
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy