All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.carrotsearch.console.launcher.PathConverter Maven / Gradle / Ivy

/*
 * console-tools
 *
 * Copyright (C) 2019, Carrot Search s.c.
 * All rights reserved.
 */
package com.carrotsearch.console.launcher;

import com.carrotsearch.console.jcommander.IStringConverter;
import com.carrotsearch.console.jcommander.IStringConverterFactory;
import java.nio.file.Path;
import java.nio.file.Paths;

public class PathConverter implements IStringConverter, IStringConverterFactory {
  @Override
  public Path convert(String value) {
    return Paths.get(value);
  }

  @SuppressWarnings({"unchecked", "rawtypes"})
  @Override
  public  Class> getConverter(Class forType) {
    if (forType.equals(Path.class)) {
      return (Class) PathConverter.class;
    }
    return null;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy