JAL-3878 Move action name initialization to its own setter.
authorMateusz Warowny <mmzwarowny@dundee.ac.uk>
Fri, 25 Mar 2022 14:46:21 +0000 (15:46 +0100)
committerMateusz Warowny <mmzwarowny@dundee.ac.uk>
Fri, 25 Mar 2022 14:46:21 +0000 (15:46 +0100)
src/jalview/ws2/actions/BaseAction.java
src/jalview/ws2/actions/alignment/AlignmentAction.java

index 0fc7aa0..97cf6fa 100644 (file)
@@ -39,9 +39,13 @@ public abstract class BaseAction<R> implements ActionI<R>
 
     protected EnumSet<CredentialType> requiredCredentials = EnumSet.noneOf(CredentialType.class);
 
-    public Builder(String name)
+    public Builder()
     {
-      this.name = name;
+    }
+
+    public void name(String val)
+    {
+      this.name = val;
     }
 
     public void webService(WebService<A> val)
@@ -112,6 +116,7 @@ public abstract class BaseAction<R> implements ActionI<R>
   {
     Objects.requireNonNull(builder.webService);
     this.webService = builder.webService;
+    Objects.requireNonNull(builder.name);
     this.name = builder.name;
     this.tooltip = builder.tooltip;
     this.subcategory = builder.subcategory;
index 040e6ef..7f935bf 100644 (file)
@@ -33,9 +33,9 @@ public class AlignmentAction extends BaseAction<AlignmentResult>
 
     protected boolean submitGaps = false;
 
-    public Builder(AlignmentWebServiceClientI client, String name)
+    public Builder(AlignmentWebServiceClientI client)
     {
-      super(name);
+      super();
       Objects.requireNonNull(client);
       this.client = client;
     }
@@ -51,9 +51,9 @@ public class AlignmentAction extends BaseAction<AlignmentResult>
     }
   }
 
-  public static Builder newBuilder(AlignmentWebServiceClientI client, String name)
+  public static Builder newBuilder(AlignmentWebServiceClientI client)
   {
-    return new Builder(client, name);
+    return new Builder(client);
   }
 
   protected final boolean submitGaps;