@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;
    }
  }
@ 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 ) ) ; return defaultValue ; } }
Gets a configuration value converted to a type.