Package com.codeforces.graygoose.validation

Source Code of com.codeforces.graygoose.validation.ConfirmPasswordValidator

package com.codeforces.graygoose.validation;

import org.nocturne.validation.ValidationException;
import org.nocturne.validation.Validator;

public class ConfirmPasswordValidator extends Validator {

    private final String password;

    public ConfirmPasswordValidator(String password) {
        this.password = password;
    }

    @Override
    public void run(String value) throws ValidationException {
        if (password == null && value == null || password != null && password.equals(value)) {
            return;
        }

        throw new ValidationException($("Password confirmation was failed."));
    }
}
TOP

Related Classes of com.codeforces.graygoose.validation.ConfirmPasswordValidator

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.