Newer
Older
CactusServer / src / main / java / cactusServer / entities / Account.java
y-ota on 24 May 2018 1 KB 癒されたい
package cactusServer.entities;

import cactusServer.utils.RandomStringGenerator;
import net.arnx.jsonic.JSONHint;

public class Account {
	private String id, name, token;
	@JSONHint(ignore = true)
	private String pass, uniqueID;
	@JSONHint(ignore = true)
	private boolean login = false;

	public Account(String userID, String userName, String userPass) {
		setId(userID);
		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 = RandomStringGenerator.generateRandomString(64, RandomStringGenerator.ALPHA_NUMERIC);
		return token;
	}

	public String getUniqueID() {
		return uniqueID;
	}

	public void setUniqueID(String uniqueID) {
		this.uniqueID = uniqueID;
	}
}