arjun4084346 commented on code in PR #3819:
URL: https://github.com/apache/gobblin/pull/3819#discussion_r1382030473


##########
gobblin-runtime/src/main/java/org/apache/gobblin/runtime/api/FlowSpec.java:
##########
@@ -423,6 +423,17 @@ public boolean isScheduled() {
     return getConfig().hasPath(ConfigurationKeys.JOB_SCHEDULE_KEY);
   }
 
+  /**
+   * Create a new FlowSpec object with the added property defined by path and 
value parameters
+   * @param path key for new property
+   * @param value
+   */
+  public FlowSpec addProperty(String path, String value) {
+    Properties properties = this.getConfigAsProperties();
+    properties.setProperty(path, value);
+    return new 
Builder(this.getUri()).withConfigAsProperties(properties).build();

Review Comment:
   Yea, I do not prefer cloning too, but `config` is `final` here. Not sure if 
it should be.
   Regarding the extra objects, the spec create in line 201 should lose 
reference by line 204, so we should be good at least in this case.



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

Reply via email to