class InputValidator {

    static public void validateUserIdNotNull(
            String className,
            String actionDescription,
            String userId) throws InvalidParameterException {
        if (userId == null) {
            ExceptionMessageDefinition messageDefinition = SubjectAreaErrorCode.NULL_USER_ID.getMessageDefinition();
            String invalidPropertyName = "userId";
            messageDefinition.setMessageParameters(invalidPropertyName, null);
            throw new InvalidParameterException(messageDefinition,
                                                className,
                                                actionDescription,
                                                invalidPropertyName,
                                                null);
        }
    }

}