How to make Java protocol buffer types mutable? Protoc.exe does not create setters?

How to make Java protocol buffer types mutable?

Protoc.exe does not create setters?

Basically, I need to create an object and then change the value of the field.

thank

+5
source share
3 answers

These are not intended libraries; you must set the values ​​at the linker stage, and then create an immutable DTO from the builder. If you need different values: change the value in the builder and restore the DTO.

As an alternative, note that there are several libraries that support the protobuf protocol specification. The IIRC prototype works with mutable POJOs.

+3
source

, protoc .

AFAIK, - ( ), , .

"" , .

( , ? build?)

+2

You can simply use collectors wherever you still want to modify objects. They have both getters and setters.

+2
source

All Articles