This trait can yield expressions to check if a field holds a default value without using JavaValueConverter and UnsetValue types.
The advantages are the following:
- The yielded expressions would be more type-tailored. Since, we no longer rely on rules, we can check the default value not only with
equals() method. For collections, strings and bytes, we can just check their size. For numbers, use == 0. And only for messages and enums, use equals().
- This trait will no longer need
UnsetValue and JavaValueConverter dependencies. The latter requires TypeSystem to be created. The approach with creating of proto Value, and then converting it to Java expression looks a bit redundant when we have a FieldType at our disposal, and can provide Expression right away.