export class EmailInput {
    public email: string;

    public static isValidEmail(email: string) {
        if (!EmailInput.isTempEmail(email)) {
            const parts: string[] = email.split('@');
            if (parts.length === 2) {
                return parts[1].indexOf('.') > 0;
            }
        }
        return false;
    }

    private static isTempEmail(email: string) {
        if (email === null || email.length <= 0) { return true; }
        if (email.indexOf('unknown') >= 0) { return true; }
        if (email.indexOf('A@A.com') >= 0) { return true; }
        return false;
    }

    public isValid() {
        return EmailInput.isValidEmail(this.email);
    }

}
