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


##########
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:
   Yes I have to clone and create a new FlowSpec because `type safe Configs` 
are immutable plus we have made `Config` a final variable (All variables are 
final). Rather than change what may be a core idea that `FlowSpecs` are 
immutable, I am creating a clone which has all the previous properties and URI 
plus the new one. 



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