Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * 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 databaseassignment;
- public class User {
- private int id;
- private String username, password;
- private boolean admin;
- public User(int id, String username, String password, boolean admin) {
- this.id = id;
- this.username = username;
- this.password = password;
- this.admin = admin;
- }
- public int getId() { return id; }
- 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 boolean isAdmin() { return admin; }
- @Override
- public String toString() {
- return "User{" + "id=" + id + ", username=" + username + ", password=" + password + ", admin=" + admin + '}';
- }
- @Override
- public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- }
- if (obj == null) {
- return false;
- }
- if (getClass() != obj.getClass()) {
- return false;
- }
- final User other = (User) obj;
- if (this.id != other.id) {
- return false;
- }
- return true;
- }
- }
Add Comment
Please, Sign In to add comment