... since Messages are immutable.
We use runtime validate in some framework places. For example, CommandFactory validates incoming command messages when producing commands.
This:
- It causes some side effects like warnings on command ID fields of primitive integer types.
- Is unnecessary if the message was already validated.
Implementation details
In order to address this we should update code generation introducing a new field which would keep the state of the call to validate(FieldPath parentPath, @Nullable TypeName parentName) to which validate() delegates. The overload with parameters does the real job on validation, and it's the one we generate.
... since
Messages are immutable.We use runtime validate in some framework places. For example,
CommandFactoryvalidates incoming command messages when producing commands.This:
Implementation details
In order to address this we should update code generation introducing a new field which would keep the state of the call to
validate(FieldPath parentPath, @Nullable TypeName parentName)to whichvalidate()delegates. The overload with parameters does the real job on validation, and it's the one we generate.