I'm using protobuf, and one of my message uses the google.protobuf.Timestamp
type.
When generating the Java-Code, the resulting protobuf classes use com.google.protobuf.Timestamp
.
Is there a way to tell protobuf to use the new Java 8 types (e.g. time.Instant
) instead? I don't want the type conversion clutter my code, everywhere I use protobuf. Ideally, it is done inside the generated code itself.
Instant instant = Instant.ofEpochSecond(timestamp.getSeconds(), timestamp.getNanos());