All Downloads are FREE. Search and download functionalities are using the official Maven repository.

fr.smallcrew.security.domain.UserToken Maven / Gradle / Ivy

Go to download

Foundation of all smallcrew's projects needing authenticated users and role management

The newest version!
package fr.smallcrew.security.domain;

import org.springframework.data.jpa.domain.AbstractPersistable;

import javax.persistence.Column;
import javax.persistence.Entity;
import java.util.Date;

import static com.google.common.base.Objects.toStringHelper;

@Entity
public class UserToken extends AbstractPersistable {
  private static final long serialVersionUID = -8242459919133080686L;

  public static final String ID = "id";
  public static final String USERNAME = "username";
  public static final String SERIES = "series";
  public static final String TOKEN_VALUE = "tokenValue";
  public static final String DATE = "date";

  @Column(nullable = false)
  private String username;

  @Column(nullable = false)
  private String series;

  @Column(nullable = false)
  private String tokenValue;

  @Column(nullable = false)
  private Date date;

  public String getUsername() {
    return username;
  }

  public void setUsername(String username) {
    this.username = username;
  }

  public String getSeries() {
    return series;
  }

  public void setSeries(String series) {
    this.series = series;
  }

  public String getTokenValue() {
    return tokenValue;
  }

  public void setTokenValue(String tokenValue) {
    this.tokenValue = tokenValue;
  }

  public Date getDate() {
    return date;
  }

  public void setDate(Date date) {
    this.date = date;
  }

  @Override
  public String toString() {
    return toStringHelper(this)
      .add(ID, getId())
      .add(USERNAME, username)
      .add(SERIES, series)
      .add(TOKEN_VALUE, tokenValue)
      .add(DATE, date)
      .toString();
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy