Retrieves the value of a property, using a given default value, and
optionally failing if there is no value.
327766
protected String getInternal(
        String defaultValue,
        boolean required)
    {
        String value = properties.getProperty(path, defaultValue);
        if (value != null) {
            return value;
        }
        if (defaultValue == null) {
            value = getDefaultValue();
            if (value != null) {
                return value;
            }
        }
        if (required) {
            throw new RuntimeException("Property " + path + " must be set");
        }
        return value;
    }
1319101
public boolean getProperty(String key, boolean defaultValue) {
        String value = getProperty(key, String.class);
        return StringUtils.isEmpty(value) ? defaultValue : Boolean.parseBoolean(value);
    }
890150
def get_prop(self, key, default_val=None):
        
        if self.props.has_key(key):
            return self.props[key]
        else:
            return default_val
1300306
function (key, defaultValue) {
            var input = self.session.get('_old_input', []);

            // Input that is flashed to the session can be easily retrieved by the
            // developer, making repopulating old forms and the like much more
            // convenient, since the request's previous input is available.
            if (key) {
                return isset(input[key]) ? input[key] : defaultValue;
            } else {
                return input;
            }
        }
817403
function getValue(property, attrVal) {
    if ((attrVal === '' || ((property.attrName || property.name) === attrVal)) && property.accepts(Boolean)) {
        return true;
    }
    if (!property.accepts(String)) {
        try {
            return JSON.parse(attrVal);
        } catch (ex) {
            //
        }
    }
    return attrVal;
}
168541
public String getProperty(String key, String defaultValue) {
        String val = properties.get(key);

        if (val == null) {
            val = defaultValue;
        }

        return val;
    }
1014878
public String get(String key, String defaultValue) {
		addToDefaults(key, defaultValue);
		String value = get(key);
		if (value == null) {
			return defaultValue;
		} else {
			return value;
		}
	}
966835
public String getProperty(String key,String defaultValue)
    {
        //get property value
        return this.PROPERTIES.getProperty(key,defaultValue);
    }
834730
protected function getPropertyValue($property, $default = null)
    {
        if (array_key_exists($property, $this->properties)) {
            return $this->properties[$property];
        }

        return $default;
    }
802868
private static Object getSimpleValue(Object obj, Property property) {
        if (property == null) {
            throw new IllegalArgumentException("Cannot get the value from a 'null' property.");
        }

        return property.get(obj);
    }
1225133
def get(self, key, defaultValue=None):
        """"""
        if defaultValue is None:   # Py4J doesn't call the right get() if we pass None
            if self._jconf is not None:
                if not self._jconf.contains(key):
                    return None
                return self._jconf.get(key)
            else:
                if key not in self._conf:
                    return None
                return self._conf[key]
        else:
            if self._jconf is not None:
                return self._jconf.get(key, defaultValue)
            else:
                return self._conf.get(key, defaultValue)
997819
def get(self, option, default=None):
        ''''''
        val = self[option]
        return (val is None and default) or val
556673
public Object getProperty(String property) {
        try {
            return super.getProperty(property);
        } catch (MissingPropertyException e) {
            Object r = context.getVariableWithDefaultValue(property,MISSING);
            if (r==MISSING) throw e;
            return r;
        }
    }
526508
public String getValueWithDefault(String keyMsgType, String defaultVal) {
        return keyToValue.getOrDefault(keyMsgType, defaultVal);
    }
965214
public <T> T get(String key, T defaultValue) {
        T value = get(key);
        if (value == null) {
            return defaultValue;
        }
        return value;
    }
245932
def _get_property_values_with_defaults(self, classname, property_values):
        """"""
        # To uphold OrientDB semantics, make a new dict with all property values set
        # to their default values, which are None if no default was set.
        # Then, overwrite its data with the supplied property values.
        final_values = self.get_default_property_values(classname)
        final_values.update(property_values)
        return final_values
1119261
public static Boolean getBooleanProperty(String key, Boolean defaultValue) {
        String value = getProperty(key);
        if((null == value) || value.isEmpty() ) {
            return (null == defaultValue) ? false : defaultValue;
        }
        if("null".equals(value.toLowerCase()) && (null != defaultValue) ) {
            return defaultValue;
        }
        return Boolean.parseBoolean(value);
    }