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

ml.bundle.BundleSerializer.scala Maven / Gradle / Ivy

The newest version!
package ml.bundle

import scala.util.Try

/**
  * Created by hollinwilkins on 3/4/18.
  */
trait BundleSerializer[Obj] {
  val key: String

  def serializeAny(obj: Any, bundle: BundleWriter): Unit = serialize(obj.asInstanceOf[Obj], bundle)
  def deserializeAny(bundle: BundleReader): Any = deserialize(bundle)

  def serialize(obj: Obj, bundle: BundleWriter): Unit
  def deserialize(bundle: BundleReader): Obj

  def validate(bundle: BundleReader): Try[Unit]
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy