-
Notifications
You must be signed in to change notification settings - Fork 857
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ExtendedConfigProperties to access complex types from file config…
…uration
- Loading branch information
Showing
9 changed files
with
643 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
...c/main/java/io/opentelemetry/sdk/autoconfigure/spi/internal/ExtendedConfigProperties.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/* | ||
* Copyright The OpenTelemetry Authors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package io.opentelemetry.sdk.autoconfigure.spi.internal; | ||
|
||
import io.opentelemetry.sdk.autoconfigure.spi.ConfigProperties; | ||
import java.util.List; | ||
import javax.annotation.Nullable; | ||
|
||
/** | ||
* An extended version of {@link ConfigProperties} that supports accessing complex types - nested | ||
* maps and arrays of maps. {@link ExtendedConfigProperties} is used as a representation of a map, | ||
* since it has (type safe) accessors for string keys. | ||
*/ | ||
public interface ExtendedConfigProperties extends ConfigProperties { | ||
|
||
/** | ||
* Returns a map-valued configuration property, represented as {@link ExtendedConfigProperties}. | ||
* | ||
* @return a map-valued configuration property, or {@code null} if {@code name} has not been | ||
* configured. | ||
* @throws io.opentelemetry.sdk.autoconfigure.spi.ConfigurationException if the property is not a | ||
* map | ||
*/ | ||
@Nullable | ||
default ExtendedConfigProperties getConfigProperties(String name) { | ||
return null; | ||
} | ||
|
||
/** | ||
* Returns a list of map-valued configuration property, represented as {@link | ||
* ExtendedConfigProperties}. | ||
* | ||
* @return a list of map-valued configuration property, or {@code null} if {@code name} has not | ||
* been configured. | ||
* @throws io.opentelemetry.sdk.autoconfigure.spi.ConfigurationException if the property is not a | ||
* list of maps | ||
*/ | ||
@Nullable | ||
default List<ExtendedConfigProperties> getListConfigProperties(String name) { | ||
return null; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 0 additions & 32 deletions
32
...rc/main/java/io/opentelemetry/sdk/extension/incubator/fileconfig/ConfigurationReader.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.