Java Properties Get getString(Properties props, String key)

Here you can find the source of getString(Properties props, String key)

Description

get String

License

Apache License

Declaration

public static String getString(Properties props, String key) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.util.*;

public class Main {

    public static String getString(Properties props, String key) {
        String value = "";
        if (props.containsKey(key)) {
            value = props.getProperty(key);
        }//  ww w .  java2s. c o m
        return value;
    }

    public static String getString(Properties props, String key,
            String defalutValue) {
        String value = defalutValue;
        if (props.containsKey(key)) {
            value = props.getProperty(key);
        }
        return value;
    }
}

Related

  1. getPropertyValueAsInt(Properties props, String key, int defaultValue)
  2. getRefValue(Properties result, String v)
  3. getSection(Properties props, String sectionName, boolean removeSectionName)
  4. getSignatureContent(Properties properties)
  5. getSignExclusions(Properties properties)
  6. getString(Properties props, String name)
  7. getString(Properties props, String name, String defaultValue)
  8. getStringConfigValue( final String configKey, final Properties config)
  9. getStringConfigVaule(Properties properties, String key, String defaultValue)