Skip to content

Update EmptyFieldCheck to avoid usage of JavaValueConverter #199

@yevhenii-nadtochii

Description

@yevhenii-nadtochii

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:

  1. 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().
  2. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions