From: Mateusz Warowny Date: Fri, 11 Mar 2022 14:26:56 +0000 (+0100) Subject: JAL-3878 Add hasPresets and hasParameters utility methods to ParamDatastoreI X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=330c10c18206e7038e14045ac5ddb15577d9e0a4;p=jalview.git JAL-3878 Add hasPresets and hasParameters utility methods to ParamDatastoreI --- diff --git a/src/jalview/ws/params/ParamDatastoreI.java b/src/jalview/ws/params/ParamDatastoreI.java index 8d28ee5..28d16d1 100644 --- a/src/jalview/ws/params/ParamDatastoreI.java +++ b/src/jalview/ws/params/ParamDatastoreI.java @@ -30,8 +30,28 @@ public interface ParamDatastoreI public WsParamSetI getPreset(String name); + /** + * Returns if the service has presets. + * @return {@code true} if service has presets + */ + public default boolean hasPresets() + { + var presets = getPresets(); + return presets != null && presets.size() > 0; + } + public List getServiceParameters(); + /** + * Returns if the service has parameters. + * @return {@code true} if service has parameters + */ + public default boolean hasParameters() + { + var parameters = getServiceParameters(); + return parameters != null && parameters.size() > 0; + } + public boolean presetExists(String name); public void deletePreset(String name);