From 330c10c18206e7038e14045ac5ddb15577d9e0a4 Mon Sep 17 00:00:00 2001 From: Mateusz Warowny Date: Fri, 11 Mar 2022 15:26:56 +0100 Subject: [PATCH] JAL-3878 Add hasPresets and hasParameters utility methods to ParamDatastoreI --- src/jalview/ws/params/ParamDatastoreI.java | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) 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); -- 1.7.10.2