chaokunyang commented on code in PR #2229:
URL: https://github.com/apache/fury/pull/2229#discussion_r2087105458


##########
java/fury-core/src/main/java/org/apache/fury/type/DescriptorBuilder.java:
##########
@@ -0,0 +1,127 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.fury.type;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+import org.apache.fury.annotation.FuryField;
+import org.apache.fury.reflect.TypeRef;
+
+public class DescriptorBuilder {
+
+  TypeRef<?> typeRef;
+  Class<?> type;
+  String typeName;
+  String name;
+  String snakeCaseName;
+  int modifier;
+  String declaringClass;
+  Field field;
+  Method readMethod;
+  Method writeMethod;
+  FuryField furyField;
+  boolean nullable;
+  boolean trackingRef;
+
+  public DescriptorBuilder(Descriptor descriptor) {
+    this.typeRef = descriptor.getTypeRef();
+    this.type = descriptor.getType();
+    this.typeName = descriptor.getTypeName();
+    this.name = descriptor.getName();
+    this.snakeCaseName = descriptor.getSnakeCaseName();
+    this.modifier = descriptor.getModifier();
+    this.declaringClass = descriptor.getDeclaringClass();
+    this.field = descriptor.getField();
+    this.readMethod = descriptor.getReadMethod();
+    this.writeMethod = descriptor.getWriteMethod();
+    this.furyField = descriptor.getFuryField();
+    this.nullable = descriptor.isNullable();
+    this.trackingRef = descriptor.isTrackingRef();
+  }
+
+  public DescriptorBuilder typeRef(TypeRef<?> typeRef) {
+    this.typeRef = typeRef;
+    return this;
+  }
+
+  public DescriptorBuilder type(Class<?> type) {
+    this.type = type;
+    return this;
+  }
+
+  public DescriptorBuilder typeName(String typeName) {
+    this.typeName = typeName;
+    return this;
+  }
+
+  public DescriptorBuilder name(String name) {
+    this.name = name;
+    return this;
+  }
+
+  public DescriptorBuilder snakeCaseName(String snakeCaseName) {

Review Comment:
   This should be consistent with name, when building descriptor, we set 
`snakeCaseName` automatically in the constructor. 



-- 
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]

Reply via email to