chaokunyang commented on code in PR #2229:
URL: https://github.com/apache/fury/pull/2229#discussion_r2087139661
##########
java/fury-core/src/main/java/org/apache/fury/type/Descriptor.java:
##########
@@ -143,14 +145,28 @@ private Descriptor(
this.furyField = this.field == null ? null :
this.field.getAnnotation(FuryField.class);
}
+ public Descriptor(DescriptorBuilder builder) {
+ this(
+ builder.typeRef,
+ builder.typeName,
+ builder.name,
+ builder.modifier,
+ builder.declaringClass,
+ builder.field,
+ builder.readMethod,
+ builder.writeMethod);
+ this.nullable = builder.nullable;
+ this.trackingRef = builder.trackingRef;
+ this.type = builder.type;
+ this.furyField = builder.furyField;
+ }
+
public Descriptor copy(Method readMethod, Method writeMethod) {
Review Comment:
Could we also add a `copyBuilder()` method in Descriptor to simplify the
usage. And could we add a test?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]