Returns the value of a property, or the default value if no value is
defined

@param key
the key of the property
@param defaultValue
the default value
@return the value of a property, or the default value if no value is
defined
555837
public String getProperty(String key, String defaultValue) {
		return props.getProperty(prefix + key, defaultValue);
	}
783410
public String optString(String key, String defaultValue) {
    Object o = opt(key);
    return o != null ? o.toString() : defaultValue;
  }
834492
public static Object findMapValueByKey(Object key, Map<?, ?> map,
	Object defaultValue)
	{
		if (key == null || map == null)
			return defaultValue;

		Object value = map.get(key);

		if (value == null)
			return defaultValue;

		return value;
	}
1287780
public T orElse(T defaultValue) {
        T value = get();

        if (value != null) {
            return value;
        }

        return defaultValue;
    }
55457
public Object getAttribute(String key, Object defaultValue)
    {
        Object attributeValue = getUserAttribute(key, null);
        if (attributeValue != null)
            return attributeValue;
        attributeValue = getSessionAttribute(key, null);
        if (attributeValue != null)
            return attributeValue;
        return defaultValue;
    }
442463
public static String getProperty(String propertyName, String defaultValue) {
        String value = get(propertyName);
        return value == null ? defaultValue : value;
    }
778156
public Object get(Object key) {
        Object val = super.get(key);
        if (val == null && key instanceof Option) {
            val = ((Option)key).defaultValue;
        }

        return val;
    }
537777
public function getValue(string $key, $defaultValue = null)
    {
        if ($this->offsetExists($key)) {
            return $this->offsetGet($key);
        } else {
            return $defaultValue;
        }
    }
995416
public String getCommonProperty(String key, String defaultValue) {
		return props.getProperty(PropertiesBundleConstant.PROPS_PREFIX + key, defaultValue);
	}
445475
public static String getSystemProperty(String key, @Nullable String defaultValue) {
    String value;
    try {
      value = System.getProperty(key);
    } catch (AccessControlException ex) {
      return defaultValue;
    }
    return value != null ? value : defaultValue;
  }
709770
public Object getProperty(PropertyKey key)
    {
        //
        // Delegate up to any parent map
        //
        if (_delegateMap != null)
            return _delegateMap.getProperty(key);

        //
        // If neither found a value, return the default value
        //
        return key.getDefaultValue();
    }
1034312
public String getProperty(String key, String defaultValue) {
        String value = getProperty(key, String.class);
        return StringUtils.isEmpty(value) ? defaultValue : value;
    }
363675
public boolean get(boolean defaultValue)
    {
        final String value =
            getInternal(
                Boolean.toString(defaultValue),
                false);
        if (value == null) {
            return defaultValue;
        }
        return toBoolean(value);
    }
1066509
public String getString(String key, String defaultValue) {
		Object o = getObject(key);
		if (o == null) {
			return defaultValue;
		}
		if (!(o instanceof String)) {
			throw new IllegalArgumentException("Object ["+o+"] associated with key ["+key+"] is not of type String.");
		}
		return (String)o;
	}
751089
public String[] getStringsWithDefault(String key, String[] defaultValue) {
		String[] value = getStrings(key, null);
		if (null == value) {
			value = defaultValue;
		}

		return value;
	}
474060
public byte getByte(String key, byte defaultValue) {
		addToDefaults(key, Byte.toString(defaultValue));
		String value = get(key);
		if (value == null) {
			return defaultValue;
		} else {
			return Byte.valueOf(value);
		}
	}
304506
function(key, defaultValue){
    var c = getCache(this.ns)

    if(arguments.length === 0) {
      return c
    }

    return c[key] !== undefined ? c[key] : defaultValue
  }