class NamedParamsDefault implements NamedParams {

  @Override
  public void mergeParametersWith( NamedParams aParam, boolean replace ) {
    if ( params != null && aParam != null && aParam.listParameters() != null ) {
      for ( String key : aParam.listParameters() ) {
        if ( replace || !params.containsKey( key ) ) {

          String desc;
          try {
            desc = aParam.getParameterDescription( key );
          } catch ( UnknownParamException e ) {
            desc = "";
          }
          String defValue;
          try {
            defValue = aParam.getParameterDefault( key );
          } catch ( UnknownParamException e ) {
            defValue = "";
          }
          String value;
          try {
            value = aParam.getParameterValue( key );
          } catch ( UnknownParamException e ) {
            value = "";
          }

          try {
            addParameterDefinition( key, defValue, desc );
          } catch ( DuplicateParamException e ) {
            params.get( key ).defaultValue = defValue;
            params.get( key ).description = desc;
          }
          setParameterValue( key, value );
        }
      }
    }
  }

  public  NamedParamsDefault();

}