class MoreMapUtils {

  public static Path getHadoopPath(Map<?, ?> map, Object key, Path defaultValue) {
    Object path = map.get(key);
    if (path == null) {
      return defaultValue;
    }
    if (path instanceof Path) {
      return (Path) path;
    }
    if (path instanceof String) {
      return new Path(((String) path).trim());
    }
    throw new IllegalArgumentException(
        "Object '" + key + "' must be a String or a Path. Got " + path.getClass().getName());
  }

  private  MoreMapUtils();

}