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

pl.touk.nussknacker.engine.api.process.VersionId.scala Maven / Gradle / Ivy

There is a newer version: 1.18.1
Show newest version
package pl.touk.nussknacker.engine.api.process

import io.circe.{Decoder, Encoder}

final case class VersionId(value: Long) {
  def increase: VersionId = VersionId(value + 1)

  override def toString: String = value.toString
}

object VersionId {

  val initialVersionId: VersionId = VersionId(1)

  implicit val encoder: Encoder[VersionId] = Encoder.encodeLong.contramap(_.value)
  implicit val decoder: Decoder[VersionId] = Decoder.decodeLong.map(VersionId(_))
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy