Pops (Protocol Buffer Ops) makes working generically with protocol buffers a simpler (and faster) experience.
Protocol buffers (PB) make use of code generation to provide, among other things, static methods. These methods can't adhere to an interface in Java. Pops eases this burden by providing type classes and a way to easily create typed accessor functions to extract data from com.google.protobuf.GeneratedMessage
s.
The code is designed to use compile-time reflection (macros) and more specifically implicit materialization to avoid the cost of runtime reflection present in most solutions. There are runtime variant available for those cases when absolutely necessary, for instance when creating a Class
object from a Class.forName
call. However, if you know the types at compile-time, the macro-based versions are considerably faster.
- ProtoOps: a
type class for working with
com.google.protobuf.GeneratedMessage
s. - EnumProtoOps: a type class for working with
com.google.protobuf.ProtocolMessageEnum
s. - ProtoAccessor a trait extending
scala.Function1
that can be created from a string-based path into the PB instance.