package me.chyxion.tigon.shiro.model;

/**
 * @version 0.0.1
 * @since 0.0.1
 * @author Shaun Chyxion <br>
 * chyxion@163.com <br>
 * Apr 7, 2015 3:13:16 PM
 */
public class Credential {
    private Object credential;
    private Object salt;
    private Object extra;

    /**
     * @param credential credential
     * @param salt salt
     */
    public Credential(Object credential, Object salt) {
        this.credential = credential;
        this.salt = salt;
    }
    
    /**
     * @param credential credential
     * @param salt salt
     * @param extra extra
     */
    public Credential(Object credential, Object salt, Object extra) {
        super();
        this.credential = credential;
        this.salt = salt;
        this.extra = extra;
    }

    /**
     * @return the credential
     */
    public Object getCredential() {
        return credential;
    }

    /**
     * @param credential the credential to set
     * @return this
     */
    public Credential setCredential(Object credential) {
        this.credential = credential;
        return this;
    }

    /**
     * @return the salt
     */
    public Object getSalt() {
        return salt;
    }

    /**
     * @param salt the solt to set
     * @return this
     */
    public Credential setSalt(Object salt) {
        this.salt = salt;
        return this;
    }

    /**
     * @param <T> extra type
     * @return the extra
     */
    @SuppressWarnings("unchecked")
    public <T> T getExtra() {
        return (T) extra;
    }

    /**
     * @param extra the extra to set
     * @return this
     */
    public Credential setExtra(Object extra) {
        this.extra = extra;
        return this;
    }
}
