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

com.wavesplatform.network.message.MessageSpec.scala Maven / Gradle / Ivy

The newest version!
package com.wavesplatform.network.message

import scala.reflect.ClassTag
import scala.util.Try

abstract class MessageSpec[Content <: AnyRef](implicit contentCt: ClassTag[Content]) {
  val contentClass: Class[_] = contentCt.runtimeClass
  val messageCode: Message.MessageCode
  final val messageName: String = """Spec\$$""".r.replaceAllIn(getClass.getSimpleName, "")

  def maxLength: Int

  def deserializeData(bytes: Array[Byte]): Try[Content]

  def serializeData(data: Content): Array[Byte]

  override def toString: String = s"MessageSpec($messageCode: $messageName)"
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy