Newer
Older
CactusServer / src / main / java / cactusServer / entities / Account.java
y-ota on 31 May 2018 1 KB jacksonをコメントアウト
package cactusServer.entities;

//import com.fasterxml.jackson.annotation.JsonIgnore;
//import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

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

public class Account extends Entity {
	private String id, name, token, pass, uniqueID;
	private boolean login = false;

	public Account(String userID, String userName, String userPass, String uniqueID) {
		setId(userID);
		setName(userName);
		setPass(userPass);
		setUniqueID(uniqueID);
		formToken();
	}

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

	@JSONHint(ignore = true)
	public String getPass() {
		return pass;
	}

	public void setPass(String pass) {
		this.pass = pass;
	}

	@JSONHint(ignore = true)
	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;
	}

	@JSONHint(ignore = true)
	public String getUniqueID() {
		return uniqueID;
	}

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