mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 06:37:19 -04:00
parent
7db4fab775
commit
0910353d71
1 changed files with 3 additions and 0 deletions
|
@ -39,6 +39,9 @@ public final class ConfigurationImpl implements Configuration {
|
|||
Object o = rawSettings.get(configSpec.name());
|
||||
if (configSpec.type().isAssignableFrom(o.getClass())) {
|
||||
return (T) o;
|
||||
} else if (configSpec.type() == Codec.class && o instanceof String && pluginFactory != null) {
|
||||
Codec codec = pluginFactory.buildDefaultCodec((String)o);
|
||||
return configSpec.type().cast(codec);
|
||||
} else {
|
||||
throw new IllegalStateException(
|
||||
String.format("Setting value for '%s' of type '%s' incompatible with defined type of '%s'",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue