// Path: src/main/java/pl/domzal/junit/docker/rule/ex/InvalidParameter.java
// public class InvalidParameter extends IllegalStateException {
// 
//     public InvalidParameter(String message) {
//         super(message);
//     }
// 
// }


import java.util.regex.Pattern;
import org.apache.commons.lang3.StringUtils;
import pl.domzal.junit.docker.rule.ex.InvalidParameter;
package pl.domzal.junit.docker.rule;




class LinkNameValidator {

    private static final String VALID_NAME_REGEX = "[a-zA-Z0-9_-]+";
    private static final String VALID_LINK_DEFINITION_REGEX = "[a-zA-Z0-9_-]+(:[a-zA-Z0-9_-]+)?";

    private static Pattern NAME_PATTERN = Pattern.compile(VALID_NAME_REGEX);
    private static Pattern LINK_PATTERN = Pattern.compile(VALID_LINK_DEFINITION_REGEX);

    public static String validateContainerName(String name) {
        if (StringUtils.isBlank(name)) {
// Path: src/main/java/pl/domzal/junit/docker/rule/ex/InvalidParameter.java
// public class InvalidParameter extends IllegalStateException {
// 
//     public InvalidParameter(String message) {
//         super(message);
//     }
// 
// }


// Path: src/main/java/pl/domzal/junit/docker/rule/LinkNameValidator.java
import java.util.regex.Pattern;
import org.apache.commons.lang3.StringUtils;
import pl.domzal.junit.docker.rule.ex.InvalidParameter;

package pl.domzal.junit.docker.rule;




class LinkNameValidator {

    private static final String VALID_NAME_REGEX = "[a-zA-Z0-9_-]+";
    private static final String VALID_LINK_DEFINITION_REGEX = "[a-zA-Z0-9_-]+(:[a-zA-Z0-9_-]+)?";

    private static Pattern NAME_PATTERN = Pattern.compile(VALID_NAME_REGEX);
    private static Pattern LINK_PATTERN = Pattern.compile(VALID_LINK_DEFINITION_REGEX);

    public static String validateContainerName(String name) {
        if (StringUtils.isBlank(name)) {
            throw new InvalidParameter("Name definition is empty");