Add ranged(Integer|Double) parameter static calls for discoverability
@@ -602,6 +602,32 @@ static Parameter seq(@NonNull final Iterable<Parameter> parameters) {
return Parameter.builder(PluginContainer.class, CatalogedValueParameters.PLUGIN);
}
+ /**
+ * Creates a builder that has the {@link ValueParameter} set to
+ * {@link VariableValueParameters#doubleRange()}, using the specified
+ * bounds (inclusive).
+ *
+ * @param min The minimum value.
+ * @param max The maximum value.
+ * @return A {@link Parameter.Value.Builder}
+ */
+ static Parameter.Value.Builder<Double> rangedDouble(final double min, final double max) {
+ return Parameter.builder(Double.class).parser(VariableValueParameters.doubleRange().setMin(min).setMax(max).build());
+ }
+
+ /**
+ * Creates a builder that has the {@link ValueParameter} set to
+ * {@link VariableValueParameters#integerRange()}, using the specified
+ * bounds (inclusive).
+ *
+ * @param min The minimum value.
+ * @param max The maximum value.
+ * @return A {@link Parameter.Value.Builder}
+ */
+ static Parameter.Value.Builder<Integer> rangedInteger(final int min, final int max) {
+ return Parameter.builder(Integer.class).parser(VariableValueParameters.integerRange().setMin(min).setMax(max).build());
+ }
+
/**
* Creates a builder that has the {@link ValueParameter} set to
* {@link CatalogedValueParameters#REMAINING_JOINED_STRINGS}.
