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

morfologik.tools.CustomParameterConverters Maven / Gradle / Ivy

There is a newer version: 2.1.9
Show newest version
package morfologik.tools;

import java.nio.file.Path;
import java.nio.file.Paths;

import com.beust.jcommander.IStringConverter;
import com.beust.jcommander.IStringConverterFactory;

class CustomParameterConverters implements IStringConverterFactory {
  public static class PathConverter implements IStringConverter {
    @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 - 2025 Weber Informatics LLC | Privacy Policy