MiniDigger/Hangar

View on GitHub
models/src/main/scala/ore/db/impl/common/Expirable.scala

Summary

Maintainability
A
0 mins
Test Coverage
package ore.db.impl.common

import java.time.Instant

/**
  * Represents something that has an expiration date.
  */
trait Expirable {

  /**
    * Time of expiration.
    *
    * @return Instant of expiration
    */
  def expiration: Instant

  /**
    * True if has expired and should be treated as such.
    *
    * @return True if expired
    */
  def hasExpired: Boolean = expiration.isBefore(Instant.now())

}