package no.toyota.gatekeeper.authenticate;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.apache.ignite.cache.affinity.AffinityKeyMapped;
import org.apache.ignite.cache.query.annotations.QuerySqlField;

/**
 * @author thomas.isaksen@gmail.com
 */
@ApiModel(description = "A Basic credentials representation.")
public class Credentials
{
    @ApiModelProperty(hidden = true)
    private long id;
    @ApiModelProperty(required = true)
    private String username;
    @ApiModelProperty(required = true)
    private String password;
    @ApiModelProperty(hidden = true)
    private String resourceId;

    public Credentials()
    {
    }

    public Credentials(String username, String password)
    {
        this.username = username;
        this.password = password;
    }

    public Credentials(String username, String password, String resourceId)
    {
        this.username = username;
        this.password = password;
        this.resourceId = resourceId;
    }

    public long getId() { return id; }

    public void setId(long id) { this.id = id; }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getResourceId() {
        return resourceId;
    }

    public void setResourceId(String resourceId) {
        this.resourceId = resourceId;
    }

    @Override
    public String toString()
    {
        return "Credentials{" +
                "id=" + id +
                ", username='" + username + '\'' +
                ", password='" + password + '\'' +
                ", resourceId='" + resourceId + '\'' +
                '}';
    }
}
