* @return a new {@link Optional} object wrapping the created {@link Settings}
*/
public static Settings read(final InputStream stream) {
Objects.requireNonNull(stream);
final Constructor constructor = new Constructor(Settings.class);
final TypeDescription settingsDescription = new TypeDescription(Settings.class);
settingsDescription.putMapPropertyType("graphs", String.class, String.class);
settingsDescription.putMapPropertyType("scriptEngines", String.class, ScriptEngineSettings.class);
settingsDescription.putListPropertyType("serializers", SerializerSettings.class);
settingsDescription.putListPropertyType("use", List.class);
settingsDescription.putListPropertyType("processors", ProcessorSettings.class);
constructor.addTypeDescription(settingsDescription);
final TypeDescription serializerSettingsDescription = new TypeDescription(SerializerSettings.class);
serializerSettingsDescription.putMapPropertyType("config", String.class, Object.class);
constructor.addTypeDescription(serializerSettingsDescription);
final TypeDescription scriptEngineSettingsDescription = new TypeDescription(ScriptEngineSettings.class);
scriptEngineSettingsDescription.putListPropertyType("imports", String.class);
scriptEngineSettingsDescription.putListPropertyType("staticImports", String.class);
scriptEngineSettingsDescription.putListPropertyType("scripts", String.class);
scriptEngineSettingsDescription.putMapPropertyType("config", String.class, Object.class);
constructor.addTypeDescription(scriptEngineSettingsDescription);
final TypeDescription sslSettings = new TypeDescription(SslSettings.class);
constructor.addTypeDescription(sslSettings);
final TypeDescription serverMetricsDescription = new TypeDescription(ServerMetrics.class);
constructor.addTypeDescription(serverMetricsDescription);
final TypeDescription consoleReporterDescription = new TypeDescription(ConsoleReporterMetrics.class);
constructor.addTypeDescription(consoleReporterDescription);
final TypeDescription csvReporterDescription = new TypeDescription(CsvReporterMetrics.class);
constructor.addTypeDescription(csvReporterDescription);
final TypeDescription jmxReporterDescription = new TypeDescription(JmxReporterMetrics.class);
constructor.addTypeDescription(jmxReporterDescription);
final TypeDescription slf4jReporterDescription = new TypeDescription(Slf4jReporterMetrics.class);
constructor.addTypeDescription(slf4jReporterDescription);
final TypeDescription gangliaReporterDescription = new TypeDescription(GangliaReporterMetrics.class);
constructor.addTypeDescription(gangliaReporterDescription);
final TypeDescription graphiteReporterDescription = new TypeDescription(GraphiteReporterMetrics.class);
constructor.addTypeDescription(graphiteReporterDescription);
final Yaml yaml = new Yaml(constructor);
return yaml.loadAs(stream, Settings.class);
}