package com.bonus.canteen.core.secure;

import com.fasterxml.jackson.annotation.JsonIgnore;

import java.time.Instant;
import java.util.Set;

public class PmsCache {
   private long expireTime;
   private Set<String> pms;

   @JsonIgnore
   public boolean isExpired() {
      return Instant.now().getEpochSecond() > this.expireTime;
   }

   public long getExpireTime() {
      return this.expireTime;
   }

   public Set<String> getPms() {
      return this.pms;
   }

   public void setExpireTime(final long expireTime) {
      this.expireTime = expireTime;
   }

   public void setPms(final Set<String> pms) {
      this.pms = pms;
   }

   public PmsCache(final long expireTime, final Set<String> pms) {
      this.expireTime = expireTime;
      this.pms = pms;
   }

   public PmsCache() {
   }
}
