chatwork / bytearray-schema

schemaless byte array complex to Scala type coversion

Version Matrix

bytearray-schema

Schemaless byte-array complex from/to Scala case class converter.

CircleCI

Install

libraryDependencies ++= Seq(
  "com.chatwork" %% "bytearray-schema" % "1.0.0",
  "com.chatwork" %% "bytearray-schema-hbase" % "1.0.0",
)

Usage

Note) package name starts with tanukki since this is a fork of https://github.com/TanUkkii007/bytearray-schema

import tanukkii.bytearrayschema.BytesMapFormat
import tanukkii.bytearrayschema.hbase.HBaseBytesMapProtocol

case class HMessageBody(id: Long, message: String, created_at: Long)

object HBaseMessageBodyBytesMapProtocol extends HBaseBytesMapProtocol {
  implicit val HBaseMessageBodyFormat: BytesMapFormat[HBaseMessageBody] = bytesMapFormat8(HBaseMessageBody)
}