I see insertion points inside getters and setters in new protobufs. Thank you, this is exactly what I needed.
2015-07-13 19:50 GMT+02:00 Pavol Ostertag <[email protected]>: > Thank you. However, your proposed solution uncovers otherwise transparent > behavior of the field. It puts a responsibility of encryption handling on > author of the data, instead on the DTO (data transfer object) itself. > > With "insertion point" (let's call it so despite it likely will not be > one) you can get always string value (as it is defined) which is > transparently encoded (as the value of the option dictates). > > 2015-07-13 19:43 GMT+02:00 Feng Xiao <[email protected]>: > >> On Mon, Jul 13, 2015 at 9:47 AM, Pavol Ostertag <[email protected] >> > wrote: >> >>> Is it possible to generate custom getters and setters for certain field? >>> Are there any field-level "insertion points" planned? >>> >> We add "insertion points" per user requests. Feel free to send us PRs to >> add insertion points that you think are needed. >> >> >>> >>> My use-case: I have field with option=encrypted. I want to encrypt >>> content of this (string) field after everyset() and decrypt before every >>> get(). >>> >> It's unlikely that "insertion points" can be used to change the behavior >> of existing generated methods (like get()/set()). I suggest adding some new >> methods for your use case instead. Something like >> get_encrypted()/set_encrypted(). >> >> >>> >>> Thank you >>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "Protocol Buffers" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to [email protected]. >>> To post to this group, send email to [email protected]. >>> Visit this group at http://groups.google.com/group/protobuf. >>> For more options, visit https://groups.google.com/d/optout. >>> >> >> > -- You received this message because you are subscribed to the Google Groups "Protocol Buffers" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/protobuf. For more options, visit https://groups.google.com/d/optout.
