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

com.github.marschal.svndiffstat.ProtocolParameterValidator Maven / Gradle / Ivy

The newest version!
package com.github.marschal.svndiffstat;

import com.beust.jcommander.IValueValidator;
import com.beust.jcommander.ParameterException;

public class ProtocolParameterValidator implements IValueValidator {
  
  static final String FILE = "file";
  static final String DAV = "dav";
  static final String SVN = "svn";

  @Override
  public void validate(String name, String value) throws ParameterException {
    if (value != null) {
      if (!value.equals(FILE) && !value.equals(DAV) && !value.equals(SVN)) {
        throw new ParameterException("Parameter " + name + " should be missing or one of \"" + FILE + "\", \"" + DAV + "\", \"" + SVN + "\" (found " + value +")");
      }
    }

  }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy