|
@@ -1409,10 +1409,6 @@ public class Setting<T> implements ToXContentObject {
|
|
|
return value;
|
|
|
}
|
|
|
|
|
|
- public static long parseLong(String s, long minValue, String key) {
|
|
|
- return parseLong(s, minValue, key, false);
|
|
|
- }
|
|
|
-
|
|
|
static long parseLong(String s, long minValue, String key, boolean isFiltered) {
|
|
|
long value = Long.parseLong(s);
|
|
|
if (value < minValue) {
|
|
@@ -1422,14 +1418,6 @@ public class Setting<T> implements ToXContentObject {
|
|
|
return value;
|
|
|
}
|
|
|
|
|
|
- public static TimeValue parseTimeValue(String s, TimeValue minValue, String key) {
|
|
|
- TimeValue timeValue = TimeValue.parseTimeValue(s, null, key);
|
|
|
- if (timeValue.millis() < minValue.millis()) {
|
|
|
- throw new IllegalArgumentException("Failed to parse value [" + s + "] for setting [" + key + "] must be >= " + minValue);
|
|
|
- }
|
|
|
- return timeValue;
|
|
|
- }
|
|
|
-
|
|
|
public static Setting<Integer> intSetting(String key, int defaultValue, Property... properties) {
|
|
|
return intSetting(key, defaultValue, Integer.MIN_VALUE, properties);
|
|
|
}
|
|
@@ -1442,22 +1430,6 @@ public class Setting<T> implements ToXContentObject {
|
|
|
return new Setting<>(key, fallbackSetting, b -> parseBoolean(b, key, isFiltered(properties)), properties);
|
|
|
}
|
|
|
|
|
|
- public static Setting<Boolean> boolSetting(
|
|
|
- String key,
|
|
|
- Setting<Boolean> fallbackSetting,
|
|
|
- Validator<Boolean> validator,
|
|
|
- Property... properties
|
|
|
- ) {
|
|
|
- return new Setting<>(
|
|
|
- new SimpleKey(key),
|
|
|
- fallbackSetting,
|
|
|
- fallbackSetting::getRaw,
|
|
|
- b -> parseBoolean(b, key, isFiltered(properties)),
|
|
|
- validator,
|
|
|
- properties
|
|
|
- );
|
|
|
- }
|
|
|
-
|
|
|
public static Setting<Boolean> boolSetting(String key, boolean defaultValue, Validator<Boolean> validator, Property... properties) {
|
|
|
return new Setting<>(key, Boolean.toString(defaultValue), b -> parseBoolean(b, key, isFiltered(properties)), validator, properties);
|
|
|
}
|
|
@@ -1686,25 +1658,6 @@ public class Setting<T> implements ToXContentObject {
|
|
|
return listSetting(key, fallbackSetting, singleValueParser, (s) -> parseableStringToList(fallbackSetting.getRaw(s)), properties);
|
|
|
}
|
|
|
|
|
|
- public static <T> Setting<List<T>> listSetting(
|
|
|
- final String key,
|
|
|
- final Function<String, T> singleValueParser,
|
|
|
- final Function<Settings, List<String>> defaultStringValue,
|
|
|
- final Property... properties
|
|
|
- ) {
|
|
|
- return listSetting(key, null, singleValueParser, defaultStringValue, properties);
|
|
|
- }
|
|
|
-
|
|
|
- public static <T> Setting<List<T>> listSetting(
|
|
|
- final String key,
|
|
|
- final Function<String, T> singleValueParser,
|
|
|
- final Function<Settings, List<String>> defaultStringValue,
|
|
|
- final Validator<List<T>> validator,
|
|
|
- final Property... properties
|
|
|
- ) {
|
|
|
- return listSetting(key, null, singleValueParser, defaultStringValue, validator, properties);
|
|
|
- }
|
|
|
-
|
|
|
public static <T> Setting<List<T>> listSetting(
|
|
|
final String key,
|
|
|
final @Nullable Setting<List<T>> fallbackSetting,
|