package org.ntlab.radishforandroidstudio.cactusClient.models;

import net.arnx.jsonic.JSONHint;

public class Account {
    private String id, name, token, pass, uniqueID;
    private boolean login = false;
    private Account(){
    }

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

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

    public boolean isLogin() {
        return login;
    }

    public void setLogin(boolean login) {
        this.login = login;
    }

    public void setToken(String token){
        this.token = token;

    }

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