/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.coderbd.pos.entity;

import java.util.Objects;
import org.springframework.stereotype.Component;

/**
 *
 * @author Biswajit Debnath
 */
public class User {

    private int userId;
    private String username;
    private String password;
    private String name;
    private String mobile;
    private String authority;
    private boolean active;

    public User() {
    }

    public User(int userId, String username, String password, String name, String mobile, String authority, boolean active) {
        this.userId = userId;
        this.username = username;
        this.password = password;
        this.name = name;
        this.mobile = mobile;
        this.authority = authority;
        this.active = active;
    }

    public User(String username, String password, String name, String mobile, String authority, boolean active) {
        this.username = username;
        this.password = password;
        this.name = name;
        this.mobile = mobile;
        this.authority = authority;
        this.active = active;
    }

    public int getUserId() {
        return userId;
    }

    public void setUserId(int userId) {
        this.userId = userId;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    public String getAuthority() {
        return authority;
    }

    public void setAuthority(String authority) {
        this.authority = authority;
    }

    public boolean isActive() {
        return active;
    }

    public void setActive(boolean active) {
        this.active = active;
    }

    @Override
    public String toString() {
        return "User{" + "userId=" + userId + ", username=" + username + ", name=" + name + ", mobile=" + mobile + ", authority=" + authority + ", active=" + active + '}';
    }

    @Override
    public int hashCode() {
        int hash = 7;
        hash = 17 * hash + this.userId;
        hash = 17 * hash + Objects.hashCode(this.username);
        hash = 17 * hash + Objects.hashCode(this.password);
        hash = 17 * hash + Objects.hashCode(this.name);
        hash = 17 * hash + Objects.hashCode(this.mobile);
        hash = 17 * hash + Objects.hashCode(this.authority);
        hash = 17 * hash + (this.active ? 1 : 0);
        return hash;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final User other = (User) obj;
        if (this.userId != other.userId) {
            return false;
        }
        if (!Objects.equals(this.username, other.username)) {
            return false;
        }
        if (!Objects.equals(this.password, other.password)) {
            return false;
        }
        if (!Objects.equals(this.name, other.name)) {
            return false;
        }
        if (!Objects.equals(this.mobile, other.mobile)) {
            return false;
        }
        if (!Objects.equals(this.authority, other.authority)) {
            return false;
        }
        if (this.active != other.active) {
            return false;
        }
        return true;
    }

}
