Here you can find the source of getString(Properties props, String name, String defaultValue)
Parameter | Description |
---|---|
props | a parameter |
name | a parameter |
defaultValue | a parameter |
public static String getString(Properties props, String name, String defaultValue)
//package com.java2s; //License from project: Open Source License import java.util.*; public class Main { /**// w w w .j a v a 2 s .c om * Get a string property, or, if no such property is defined, return * the given default value * * @param props * @param name * @param defaultValue * @return */ public static String getString(Properties props, String name, String defaultValue) { return props.containsKey(name) ? props.getProperty(name) : defaultValue; } public static String getString(Properties props, String name) { if (props.containsKey(name)) { return props.getProperty(name); } throw new IllegalArgumentException("Missing required property '" + name + "'"); } }