class ListenerConfiguration {

    public static ListenerConfiguration from(HierarchicalConfiguration<ImmutableNode> configuration) {
        String listenerClass = configuration.getString("class");
        Preconditions.checkState(!Strings.isNullOrEmpty(listenerClass), "class name is mandatory");
        Optional<Boolean> isAsync = Optional.ofNullable(configuration.getBoolean("async", null));
        Optional<String> group = Optional.ofNullable(configuration.getString("group", null));
        return new ListenerConfiguration(listenerClass, group, extractSubconfiguration(configuration), isAsync);
    }

    private  ListenerConfiguration(String clazz, Optional<String> group, Optional<HierarchicalConfiguration<ImmutableNode>> configuration, Optional<Boolean> isAsync);

}