static ConfigListener forPath()

in iep-dynconfig/src/main/java/com/netflix/iep/config/ConfigListener.java [46:54]


  static ConfigListener forPath(String path, Consumer<Config> consumer) {
    return (previous, current) -> {
      Config c1 = (path == null) ? previous : ListenerUtils.getConfig(previous, path);
      Config c2 = (path == null) ? current : ListenerUtils.getConfig(current, path);
      if (ListenerUtils.hasChanged(c1, c2)) {
        consumer.accept(c2);
      }
    };
  }