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

one.lfa.epubsquash.cmdline.ESLogLevelConverter Maven / Gradle / Ivy

There is a newer version: 1.0.1
Show newest version
package one.lfa.epubsquash.cmdline;

import com.beust.jcommander.IStringConverter;

import java.util.Objects;

/**
 * A converter for {@link ESLogLevel} values.
 */

public final class ESLogLevelConverter implements IStringConverter
{
  /**
   * Construct a new converter.
   */

  public ESLogLevelConverter()
  {

  }

  @Override
  public ESLogLevel convert(final String value)
  {
    for (final var v : ESLogLevel.values()) {
      if (Objects.equals(value, v.getName())) {
        return v;
      }
    }

    throw new ESLogLevelUnrecognized(
      "Unrecognized verbosity level: " + value);
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy