Newer
Older
CactusServer / src / main / java / cactusServer / entities / Account.java
y-ota on 24 May 2018 1 KB Accounts修正
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 {
	private String id, name, token;
	@JSONHint(ignore = true)
	private String pass;
	@JSONHint(ignore = true)
	private String uniqueID;
	@JSONHint(ignore = true)
	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;
	}
	
	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;
	}
}