package ru.micord.ervu.security.webbpm.jwt.model;

import java.util.Date;

public class Token {
  private final String userAccountId;
  private final String issuer;
  private final Date expirationDate;
  private final String value;
  private final Boolean hasRole;

  public Token(String userAccountId, String issuer, Date expirationDate, String value, Boolean hasRole) {
    this.userAccountId = userAccountId;
    this.issuer = issuer;
    this.expirationDate = expirationDate;
    this.value = value;
    this.hasRole = hasRole;
  }

  public String getUserAccountId() {
    return userAccountId;
  }

  public String getIssuer() {
    return issuer;
  }

  public Date getExpirationDate() {
    return expirationDate;
  }

  public boolean isExpired() {
    return expirationDate.before(new Date());
  }

  public String getValue() {
    return value;
  }

  public Boolean getHasRole() {
    return hasRole;
  }
}
