class HandlerKeyValidator {

    public void validateGeneratedKey(final String handlerKey, final String handlerClassName) {
        if (handlerKey == null || (handlerKey.contains(SequenceConstants.SEQUENCE_KEY_SEPARATOR.getConstant())
                || handlerKey.contains(SequenceConstants.SEQUENCE_ID_SEPARATOR.getConstant()))) {
            throw new SequenceHandlerKeyValidationException(handlerKey + " is not valid, handler(" + handlerClassName + "). Forbidden charaters: "
                    + SequenceConstants.SEQUENCE_KEY_SEPARATOR.getConstant() + " " + SequenceConstants.SEQUENCE_ID_SEPARATOR.getConstant());
        }
    }

}