Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mark Config.getKeys as @Deprecated #679

Merged
merged 1 commit into from
Sep 29, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
22 changes: 15 additions & 7 deletions archaius2-api/src/main/java/com/netflix/archaius/api/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
/**
* Core API for reading a configuration. The API is read only.
*/
@SuppressWarnings("JavadocDeclaration") // TODO: Fix up all the javadocs and remove this suppression
public interface Config extends PropertySource {

/**
Expand Down Expand Up @@ -60,7 +61,7 @@ interface Visitor<T> {
void removeListener(ConfigListener listener);

/**
* Return the raw, uninterpolated, object associated with a key.
* Return the raw, un-interpolated, object associated with a key.
* @param key
*/
Object getRawProperty(String key);
Expand Down Expand Up @@ -146,7 +147,7 @@ default boolean instrumentationEnabled() {

/**
* Get the property from the Decoder. All basic data types as well any type
* will a valueOf or String contructor will be supported.
* will a valueOf or String constructor will be supported.
* @param type
* @param key
* @return
Expand All @@ -156,7 +157,7 @@ default boolean instrumentationEnabled() {

/**
* Get the property from the Decoder. All basic data types as well any type
* will a valueOf or String contructor will be supported.
* will a valueOf or String constructor will be supported.
* @param type
* @param key
* @return
Expand All @@ -166,24 +167,31 @@ default boolean instrumentationEnabled() {

/**
* @param key
* @return True if the key is contained within this or any of it's child configurations
* @return True if the key is contained within this or any of its child configurations
*/
boolean containsKey(String key);

/**
* @return Return an unmodifiable Iterator to all property names owned by this config
* @return An unmodifiable Iterator over all property names owned by this config
* @deprecated Use {@link #keys()} instead.
*/
@Deprecated
Iterator<String> getKeys();

/**
* @return Return an unmodifiable Iterable of all property names owned by this config.
* Returns an unmodifiable Iterable of all property names owned by this config.
* <p>
* The default in this interface simply returns a thunk call to {@link #getKeys()}. Implementations are
* encouraged to provide their own version. The simplest approach, if the implementation has a {@link java.util.Map}
* or similar as its backing store, is to return an equivalent to
* <code>Collections.unmodifiableSet(map.keySet())</code>.
*/
default Iterable<String> keys() {
return this::getKeys;
}

/**
* @return Return an interator to all prefixed property names owned by this config
* @return Return an iterator over all prefixed property names owned by this config
*/
Iterator<String> getKeys(String prefix);

Expand Down