From: Mateusz Warowny Date: Thu, 8 Jul 2021 13:39:16 +0000 (+0200) Subject: JAL-3848 SlivkaParamSet: reformat code and add service description. X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=a89da84a990b90bf9691bba2403a38c42bd2dfb7;p=jalview.git JAL-3848 SlivkaParamSet: reformat code and add service description. --- diff --git a/src/jalview/ws/slivkaws/SlivkaParamSet.java b/src/jalview/ws/slivkaws/SlivkaParamSet.java index 8a1d382..9b74585 100644 --- a/src/jalview/ws/slivkaws/SlivkaParamSet.java +++ b/src/jalview/ws/slivkaws/SlivkaParamSet.java @@ -1,17 +1,16 @@ package jalview.ws.slivkaws; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + import jalview.ws.params.ArgumentI; import jalview.ws.params.WsParamSetI; import jalview.ws.params.simple.BooleanOption; import jalview.ws.params.simple.DoubleParameter; import jalview.ws.params.simple.IntegerParameter; import jalview.ws.params.simple.StringParameter; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - import uk.ac.dundee.compbio.slivkaclient.Parameter; import uk.ac.dundee.compbio.slivkaclient.SlivkaService; @@ -26,7 +25,8 @@ public class SlivkaParamSet implements WsParamSetI this.service = service; for (Parameter param : service.getParameters()) { - Object defaultValue = param.getDefault() instanceof List ? ((List) param.getDefault()).get(0) + Object defaultValue = param.getDefault() instanceof List + ? ((List) param.getDefault()).get(0) : param.getDefault(); if (param instanceof Parameter.FlagParameter) { @@ -42,7 +42,9 @@ public class SlivkaParamSet implements WsParamSetI { Integer min = ((Parameter.IntegerParameter) param).getMin(); Integer max = ((Parameter.IntegerParameter) param).getMax(); - Integer defVal = defaultValue != null ? ((Number) defaultValue).intValue() : null; + Integer defVal = defaultValue != null + ? ((Number) defaultValue).intValue() + : null; args.add(new IntegerParameter(param.getId(), param.getDescription(), param.isRequired(), defVal, (min == null) ? Integer.MIN_VALUE : min, (max == null) ? Integer.MAX_VALUE : max)); @@ -51,7 +53,9 @@ public class SlivkaParamSet implements WsParamSetI { Double min = ((Parameter.DecimalParameter) param).getMin(); Double max = ((Parameter.DecimalParameter) param).getMax(); - Double defVal = defaultValue != null ? ((Number) defaultValue).doubleValue() : null; + Double defVal = defaultValue != null + ? ((Number) defaultValue).doubleValue() + : null; args.add(new DoubleParameter(param.getId(), param.getDescription(), param.isRequired(), defVal, (min == null) ? -Double.MAX_VALUE : min, (max == null) ? Double.MAX_VALUE : max)); @@ -106,7 +110,7 @@ public class SlivkaParamSet implements WsParamSetI @Override public String getDescription() { - return ""; + return service.getDescription(); } @Override