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

net.sf.aguacate.check.CheckCoupling Maven / Gradle / Ivy

There is a newer version: 0.10.9
Show newest version
package net.sf.aguacate.check;

import java.util.HashMap;
import java.util.Map;

import net.sf.aguacate.check.impl.CheckNotNull;
import net.sf.aguacate.check.impl.CheckNotNullAndNotEmpty;
import net.sf.aguacate.check.impl.CheckNull;
import net.sf.aguacate.check.impl.CheckNullOrEmpty;

public final class CheckCoupling {

	private static final Map CHECKS;

	static {
		Map checks = new HashMap<>();
		checks.put("NOT_NULL", new CheckNotNull());
		checks.put("NULL", new CheckNull());
		checks.put("NULL_OR_EMPTY", new CheckNullOrEmpty());
		checks.put("NOT_NULL_AND_NOT_EMPTY", new CheckNotNullAndNotEmpty());
		CHECKS = checks;
	}

	private CheckCoupling() {
	}

	public static Check get(String name) {
		Check check = CHECKS.get(name);
		if (check == null) {
			throw new IllegalArgumentException(name);
		} else {
			return check;
		}
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy