Returns the value of the property associated to the key passed in
parameter

@param key
the key of the property
@param defaultValue
the default value
@return the value of the property
328228
public String getProperty(String key, String defaultValue) {

		String property = configProperties.getProperty(key, defaultValue);
		if (property != null) {
			property = property.trim();
		}
		return property;
	}
650148
public static String getProperty(File file, String key, String defaultValue) {
		String property = null;
		try {
			property = PropertiesFactory.load(file).getProperty(key);
		} catch (IOException e) {}
		return property == null ? defaultValue : property;
	}
597842
public static String getProperty(String key, String defaultValue) {
        String env = System.getenv(key);
        if (env != null && !"".equals(env)) {
            return env;
        }
        return System.getProperty(key, defaultValue);
    }
236876
public String getParam(@NotNull final String name, String defaultValue) {
        String value = getParam(name);

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

        return value;
    }
272973
public static String getValue(Map<String,String> map, String key, String defaultValue) {
		return map.containsKey( key ) ? map.get( key ) : defaultValue;
	}
1211383
public static <K, V> V getIfAbsentDefault(Map<K, V> map, K key, V defaultValue)
    {
        V result = map.get(key);
        if (MapIterate.isAbsent(result, map, key))
        {
            result = defaultValue;
        }
        return result;
    }
415668
public String get(String key, String defaultString) {
    if (!containsKey(key)) {
      return defaultString;
    }
    return get(key);
  }
736921
public int getProperty(String key, int defaultValue) {
        String value = getProperty(key, String.class);
        return StringUtils.isEmpty(value) ? defaultValue : Integer.parseInt(value);
    }
17719
public java.lang.String getTagsOrDefault(
      java.lang.String key,
      java.lang.String defaultValue) {
    if (key == null) { throw new java.lang.NullPointerException(); }
    java.util.Map<java.lang.String, java.lang.String> map =
        internalGetTags().getMap();
    return map.containsKey(key) ? map.get(key) : defaultValue;
  }
930224
public int getIntegerProperty(String key, int defaultValue, int[] values) {

        String prop  = getProperty(key);
        int    value = defaultValue;

        try {
            if (prop != null) {
                value = Integer.parseInt(prop);
            }
        } catch (NumberFormatException e) {}

        if (ArrayUtil.find(values, value) == -1) {
            return defaultValue;
        }

        return value;
    }
789407
public function get($key, $defaultValue = null)
    {
        if (!isset($this->keyToIndexMap[$key]) && 2 === func_num_args()) {
            return $defaultValue;
        }

        return $this->value($key);
    }
854571
public Float getFloatProperty(String key, Float defaultValue) {
        String val = getProperty(key, defaultValue.toString());
        try {
            Float intVal = Float.parseFloat(val);
            return intVal;
        } catch (NumberFormatException e) {
            return defaultValue;
        }
    }
783410
public String optString(String key, String defaultValue) {
    Object o = opt(key);
    return o != null ? o.toString() : defaultValue;
  }
78882
@SuppressWarnings("unchecked")
    public <T> T getProperty(String propName, T defaultValue) {
        String propValue = props.getProperty(propName);
        if (propValue == null)
            return defaultValue;
        return ReflectionUtil.<T>getObjectInstance(propValue);
    }
824629
@SuppressWarnings("unchecked")
  public <T> T get(String key, Class<T> type, T defaultValue)
  {
    Objects.requireNonNull(key);
    Objects.requireNonNull(type);

    String value = _map.get(key);

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

    if (type.equals(String.class)) {
      return (T) value;
    }

    T valueType = _converter.convert(type, value);

    if (valueType != null) {
      return valueType;
    }
    else {
      log.warning(L.l("Unexpected type for key={0} type={1} value={2}",
                      key, type, value));
      /*
      throw new ConfigException(L.l("Unexpected type for key={0} type={1} value={2}",
                                    key, type, value));
                                    */
      return defaultValue;
    }
  }
48658
@Override
  public String get(String key, String defaultValue)
  {
    String value = _map.get(key);

    if (value != null) {
      return value;
    }
    else {
      return defaultValue;
    }
  }
1118378
public java.lang.String getRetOrDefault(
      java.lang.String key,
      java.lang.String defaultValue) {
    if (key == null) { throw new java.lang.NullPointerException(); }
    java.util.Map<java.lang.String, java.lang.String> map =
        internalGetRet().getMap();
    return map.containsKey(key) ? map.get(key) : defaultValue;
  }