Closed alexander-yevsyukov closed 1 year ago
Merging #54 (233cddb) into master (6edc575) will decrease coverage by
1.13%
. The diff coverage is2.43%
.
@armiol, @dmdashenkov,
In relation to the Text
type, we probably need even a type with such or similar name introduced at the level of ProtoData or even as a separate small library under the package io.spine.text
.
We definitely have a generic subdomain which deals with text blocks, lines of text, etc. Passing ImmutableList<String>
was OK for the start, but 1) it's too many characters to read, and 2) let's not limit ourselves to generating the code only in Java.
We may also benefit from having protobuf-based type Text
in other projects.
Let's discuss this when time permits.
This PR teaches Validation to make generated code of message types to implement
ValidatableMessage
interface.This interface used to be named
MessageWithConstraints
and hadvalidate()
method which returned a list ofValidationConstraint
. Now it returnsOptional<ValidationError>
as in the recently generated code.Other notable changes:
List<String>
now uses theText
type recently introduced inbase
.BuilderInsertionPoint
.BuildMethodReturnTypeAnnotation
andBuildPartialMethodReturnTypeAnnotation
were also introduced, but could not be fully implemented because of this limitation in ProtoData.JavaValidationRenderer
was refactored extracting method objects to make the whole process easier to understand.Validate
class was renamed toValidateBeforeReturn
to better reflect the nature of the insertion point.