|
@@ -422,7 +422,7 @@ public final class ConfigurationUtils {
|
|
|
) {
|
|
|
String mediaType = readStringProperty(processorType, processorTag, configuration, propertyName, defaultValue);
|
|
|
|
|
|
- if (Arrays.asList(VALID_MEDIA_TYPES).contains(mediaType) == false) {
|
|
|
+ if (List.of(VALID_MEDIA_TYPES).contains(mediaType) == false) {
|
|
|
throw newConfigurationException(
|
|
|
processorType,
|
|
|
processorTag,
|
|
@@ -489,7 +489,7 @@ public final class ConfigurationUtils {
|
|
|
throw exception;
|
|
|
}
|
|
|
|
|
|
- return processors;
|
|
|
+ return Collections.unmodifiableList(processors);
|
|
|
}
|
|
|
|
|
|
public static TemplateScript.Factory readTemplateProperty(
|
|
@@ -516,7 +516,7 @@ public final class ConfigurationUtils {
|
|
|
// modified if templating is not available so a script that simply returns an unmodified `propertyValue`
|
|
|
// is returned.
|
|
|
if (scriptService.isLangSupported(DEFAULT_TEMPLATE_LANG) && propertyValue.contains("{{")) {
|
|
|
- Script script = new Script(ScriptType.INLINE, DEFAULT_TEMPLATE_LANG, propertyValue, Collections.emptyMap());
|
|
|
+ Script script = new Script(ScriptType.INLINE, DEFAULT_TEMPLATE_LANG, propertyValue, Map.of());
|
|
|
return scriptService.compile(script, TemplateScript.CONTEXT);
|
|
|
} else {
|
|
|
return (params) -> new TemplateScript(params) {
|
|
@@ -601,7 +601,7 @@ public final class ConfigurationUtils {
|
|
|
);
|
|
|
}
|
|
|
if (onFailureProcessors.size() > 0 || ignoreFailure) {
|
|
|
- processor = new CompoundProcessor(ignoreFailure, Collections.singletonList(processor), onFailureProcessors);
|
|
|
+ processor = new CompoundProcessor(ignoreFailure, List.of(processor), onFailureProcessors);
|
|
|
}
|
|
|
if (conditionalScript != null) {
|
|
|
processor = new ConditionalProcessor(tag, description, conditionalScript, scriptService, processor);
|
|
@@ -634,7 +634,7 @@ public final class ConfigurationUtils {
|
|
|
if (scriptConfig instanceof Map<?, ?>) {
|
|
|
return (Map<String, Object>) scriptConfig;
|
|
|
} else if (scriptConfig instanceof String) {
|
|
|
- return Collections.singletonMap("source", scriptConfig);
|
|
|
+ return Map.of("source", scriptConfig);
|
|
|
} else {
|
|
|
throw newConfigurationException(
|
|
|
"conditional",
|