Class DataSizeUnitConverter

java.lang.Object
nl.knaw.dans.lib.util.DataSizeUnitConverter
All Implemented Interfaces:
picocli.CommandLine.ITypeConverter<io.dropwizard.util.DataSizeUnit>

public class DataSizeUnitConverter extends Object implements picocli.CommandLine.ITypeConverter<io.dropwizard.util.DataSizeUnit>
A Picocli converter for DataSizeUnit. It supports both the full enum names (e.g., "MEGABYTES") and the shorthand notation used by DataSize (e.g., "MB", "MiB").
  • Constructor Details

    • DataSizeUnitConverter

      public DataSizeUnitConverter()
  • Method Details

    • convert

      public io.dropwizard.util.DataSizeUnit convert(String value) throws Exception
      Specified by:
      convert in interface picocli.CommandLine.ITypeConverter<io.dropwizard.util.DataSizeUnit>
      Throws:
      Exception