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

com.ch.validator.Validator Maven / Gradle / Ivy

package com.ch.validator;

import java.util.regex.Pattern;

import org.apache.commons.lang3.StringUtils;

public abstract class Validator {

	private final static Pattern UUID_REGEX_PATTERN = Pattern
			.compile("/^\\{?[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}‌​\\}?$/");

	public static boolean isValidSubscriptionKey(String subscriptionKey) {
		if (subscriptionKey != null && StringUtils.isNotBlank(subscriptionKey)) {
			return UUID_REGEX_PATTERN.matcher(subscriptionKey).matches();
		} else {
			return false;
		}
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy