package cactusServer.entities; import org.apache.commons.lang3.RandomStringUtils; public class Account { private String id,name, pass, token; private boolean login = false; public Account(String userName, String userPass) { setName(userName); setPass(userPass); } public String getId() { return id; } public void setId(String id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getPass() { return pass; } public void setPass(String pass) { this.pass = pass; } public boolean isLogin() { return login; } public void setLogin(boolean login) { this.login = login; } public String getToken() { return token; } public String formToken() { token = RandomStringUtils.random(64, "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"); return token; } public Account getAccount(String token) { if (this.token == token) { return this; } else { return null; } } }