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

orcus.bigtable.codec.FamilyEncoder.scala Maven / Gradle / Ivy

There is a newer version: 0.28.9
Show newest version
package orcus.bigtable.codec

import com.google.protobuf.ByteString

trait FamilyEncoder[A] {
  def apply(v: A): Map[ByteString, ByteString]
}

object FamilyEncoder extends FamilyEncoder1 {
  @inline def apply[A](implicit A: FamilyEncoder[A]): FamilyEncoder[A] = A

  implicit def encodeMap[K, V, M[_, _] <: Map[K, V]](implicit
    encodeK: PrimitiveEncoder[K],
    encodeV: PrimitiveEncoder[V]
  ): FamilyEncoder[M[K, V]] =
    _.map { case (k, v) => encodeK(k) -> encodeV(v) }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy