Java Utililty Methods Properties Get

List of utility methods to do Properties Get

Description

The list of methods to do Properties Get are organized into topic(s).

Method

StringgetSignatureContent(Properties properties)
get Signature Content
StringBuffer content = new StringBuffer();
List keys = new ArrayList(properties.keySet());
Collections.sort(keys);
for (int i = 0; i < keys.size(); i++) {
    String key = (String) keys.get(i);
    String value = properties.getProperty(key);
    content.append(String.valueOf(i != 0 ? "&" : "") + key + "=" + value);
return content.toString();
SetgetSignExclusions(Properties properties)
get Sign Exclusions
if (properties == null)
    return Collections.EMPTY_SET;
String signExcludes = properties.getProperty(SIGN_EXCLUDES);
if (signExcludes != null) {
    String[] excludes = toStringArray(signExcludes, ","); 
    Set signExclusions = new HashSet();
    for (int i = 0; i < excludes.length; i++) {
        signExclusions.add(excludes[i]);
...
StringgetString(Properties props, String key)
get String
String value = "";
if (props.containsKey(key)) {
    value = props.getProperty(key);
return value;
StringgetString(Properties props, String name)
get String
if (props.containsKey(name)) {
    return props.getProperty(name).trim();
throw new IllegalArgumentException("Missing required property '" + name + "'");
StringgetString(Properties props, String name, String defaultValue)
Get a string property, or, if no such property is defined, return the given default value
return props.containsKey(name) ? props.getProperty(name) : defaultValue;
OptionalgetStringConfigValue(final String configKey, final Properties config)
get String Config Value
final String configValue = config.getProperty(configKey);
final Optional<String> optionalConfigValue;
if (configValue != null && !configValue.trim().isEmpty()) {
    optionalConfigValue = Optional.of(configValue);
} else {
    optionalConfigValue = Optional.empty();
return optionalConfigValue;
...
StringgetStringConfigVaule(Properties properties, String key, String defaultValue)
get String Config Vaule
return checkConfigValue(properties, key, defaultValue) ? properties.getProperty(key) : null;
PropertiesgetSubProperties(Properties src, String prefix)
get Sub Properties
Properties persistenceProps = new Properties();
for (String key : src.stringPropertyNames()) {
    if (key.startsWith(prefix)) {
        String value = src.getProperty(key);
        persistenceProps.setProperty(key, value);
return persistenceProps;
...
StringgetValue(Properties properties, String key)
get Value
if (properties == null || key == null || key.isEmpty()) {
    return "";
return properties.getProperty(key, "");