public static IValidator GetByType(ValidatorType type) { IValidator validator; switch (type) { case ValidatorType.EMPTY: validator = new ValidatorEmpty(); break; case ValidatorType.MONTH: validator = new ValidatorMonth(); break; case ValidatorType.YEAR: validator = new ValidatorYear(); break; case ValidatorType.CVV: validator = new ValidatorCvv(); break; case ValidatorType.CREDIT_CARD: validator = new ValidatorCreditCard(); break; default: validator = new ValidatorEmpty(); break; } return(validator); }
public static IValidator GetByType(ValidatorType type) { IValidator validator; switch (type) { case ValidatorType.EMPTY: validator = new ValidatorEmpty(); break; case ValidatorType.MONTH: validator = new ValidatorMonth(); break; case ValidatorType.YEAR: validator = new ValidatorYear(); break; case ValidatorType.CVV: validator = new ValidatorCvv(); break; case ValidatorType.CREDIT_CARD: validator = new ValidatorCreditCard(); break; default: validator = new ValidatorEmpty(); break; } return validator; }