Config.java 841 B

1234567891011121314151617181920212223242526272829303132333435
  1. package cn.iocoder.dashboard.framework.apollox;
  2. import java.util.Set;
  3. /**
  4. * 配置接口
  5. *
  6. * @author Jason Song(song_s@ctrip.com)
  7. */
  8. public interface Config {
  9. /**
  10. * Return the property value with the given key, or {@code defaultValue} if the key doesn't exist.
  11. *
  12. * @param key the property name
  13. * @param defaultValue the default value when key is not found or any error occurred
  14. * @return the property value
  15. */
  16. String getProperty(String key, String defaultValue);
  17. /**
  18. * Return a set of the property names
  19. *
  20. * @return the property names
  21. */
  22. Set<String> getPropertyNames();
  23. /**
  24. * Add change listener to this config instance.
  25. *
  26. * @param listener the config change listener
  27. */
  28. void addChangeListener(ConfigChangeListener listener);
  29. }