From: Mateusz Warowny Date: Fri, 25 Mar 2022 14:46:21 +0000 (+0100) Subject: JAL-3878 Move action name initialization to its own setter. X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=9f37445be8452fc4e949fbb7abe732d75d23aca2;p=jalview.git JAL-3878 Move action name initialization to its own setter. --- diff --git a/src/jalview/ws2/actions/BaseAction.java b/src/jalview/ws2/actions/BaseAction.java index 0fc7aa0..97cf6fa 100644 --- a/src/jalview/ws2/actions/BaseAction.java +++ b/src/jalview/ws2/actions/BaseAction.java @@ -39,9 +39,13 @@ public abstract class BaseAction implements ActionI protected EnumSet 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 val) @@ -112,6 +116,7 @@ public abstract class BaseAction implements ActionI { Objects.requireNonNull(builder.webService); this.webService = builder.webService; + Objects.requireNonNull(builder.name); this.name = builder.name; this.tooltip = builder.tooltip; this.subcategory = builder.subcategory; diff --git a/src/jalview/ws2/actions/alignment/AlignmentAction.java b/src/jalview/ws2/actions/alignment/AlignmentAction.java index 040e6ef..7f935bf 100644 --- a/src/jalview/ws2/actions/alignment/AlignmentAction.java +++ b/src/jalview/ws2/actions/alignment/AlignmentAction.java @@ -33,9 +33,9 @@ public class AlignmentAction extends BaseAction 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 } } - 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;