Newer
Older
CactusServer / src / main / java / cactusServer / entities / Account.java
y-ota on 22 May 2018 848 bytes token生成機能実装
package cactusServer.entities;

import org.apache.commons.lang3.RandomStringUtils;

public class Account {
	private String name, pass, token;
	private boolean login = false;

	public Account(String userName, String userPass) {
		setName(userName);
		setPass(userPass);
	}

	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;
	}
}