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

im.actor.server.model.MessageState.scala Maven / Gradle / Ivy

There is a newer version: 3.0.0
Show newest version
package im.actor.server.model

sealed trait MessageState {
  def toInt: Int
}

object MessageState {
  @SerialVersionUID(1L)
  case object Sent extends MessageState {
    def toInt = 1
  }

  @SerialVersionUID(1L)
  case object Received extends MessageState {
    def toInt = 2
  }

  @SerialVersionUID(1L)
  case object Read extends MessageState {
    def toInt = 3
  }

  def fromInt(i: Int): MessageState = i match {
    case 1 ⇒ Sent
    case 2 ⇒ Received
    case 3 ⇒ Read
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy