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

com.github.j5ik2o.akka.persistence.dynamodb.model.SequenceNumber.scala Maven / Gradle / Ivy

package com.github.j5ik2o.akka.persistence.dynamodb.model

object SequenceNumber {
  val MaxValue: SequenceNumber = SequenceNumber(Long.MaxValue)
  val MinValue: SequenceNumber = SequenceNumber(0L)
}

case class SequenceNumber(value: Long) extends Ordered[SequenceNumber] {
  require(value >= 0, "Invalid value")

  override def toString: String = s"SequenceNumber($value)"

  override def compare(that: SequenceNumber): Int = {
    value compare that.value
  }

  def asString: String = value.toString
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy