33 * SPDX-License-Identifier: Apache-2.0
44 */
55
6- package io .opentelemetry .sdk . autoconfigure . spi . internal ;
6+ package io .opentelemetry .api . incubator . config ;
77
88import static io .opentelemetry .api .internal .ConfigUtil .defaultIfNull ;
99
10- import io .opentelemetry .sdk .autoconfigure .spi .ConfigProperties ;
11- import io .opentelemetry .sdk .autoconfigure .spi .ConfigurationException ;
1210import java .util .List ;
1311import java .util .Set ;
1412import javax .annotation .Nullable ;
@@ -28,7 +26,7 @@ public interface StructuredConfigProperties {
2826 * Returns a {@link String} configuration property.
2927 *
3028 * @return null if the property has not been configured
31- * @throws ConfigurationException if the property is not a valid scalar string
29+ * @throws StructuredConfigException if the property is not a valid scalar string
3230 */
3331 @ Nullable
3432 String getString (String name );
@@ -38,7 +36,7 @@ public interface StructuredConfigProperties {
3836 *
3937 * @return a {@link String} configuration property or {@code defaultValue} if a property with
4038 * {@code name} has not been configured
41- * @throws ConfigurationException if the property is not a valid scalar string
39+ * @throws StructuredConfigException if the property is not a valid scalar string
4240 */
4341 default String getString (String name , String defaultValue ) {
4442 return defaultIfNull (getString (name ), defaultValue );
@@ -49,7 +47,7 @@ default String getString(String name, String defaultValue) {
4947 * {@link Boolean#parseBoolean(String)} for handling the values.
5048 *
5149 * @return null if the property has not been configured
52- * @throws ConfigurationException if the property is not a valid scalar boolean
50+ * @throws StructuredConfigException if the property is not a valid scalar boolean
5351 */
5452 @ Nullable
5553 Boolean getBoolean (String name );
@@ -59,7 +57,7 @@ default String getString(String name, String defaultValue) {
5957 *
6058 * @return a {@link Boolean} configuration property or {@code defaultValue} if a property with
6159 * {@code name} has not been configured
62- * @throws ConfigurationException if the property is not a valid scalar boolean
60+ * @throws StructuredConfigException if the property is not a valid scalar boolean
6361 */
6462 default boolean getBoolean (String name , boolean defaultValue ) {
6563 return defaultIfNull (getBoolean (name ), defaultValue );
@@ -72,7 +70,7 @@ default boolean getBoolean(String name, boolean defaultValue) {
7270 * {@link Long#intValue()} which may result in loss of precision.
7371 *
7472 * @return null if the property has not been configured
75- * @throws ConfigurationException if the property is not a valid scalar integer
73+ * @throws StructuredConfigException if the property is not a valid scalar integer
7674 */
7775 @ Nullable
7876 Integer getInt (String name );
@@ -85,7 +83,7 @@ default boolean getBoolean(String name, boolean defaultValue) {
8583 *
8684 * @return a {@link Integer} configuration property or {@code defaultValue} if a property with
8785 * {@code name} has not been configured
88- * @throws ConfigurationException if the property is not a valid scalar integer
86+ * @throws StructuredConfigException if the property is not a valid scalar integer
8987 */
9088 default int getInt (String name , int defaultValue ) {
9189 return defaultIfNull (getInt (name ), defaultValue );
@@ -95,7 +93,7 @@ default int getInt(String name, int defaultValue) {
9593 * Returns a {@link Long} configuration property.
9694 *
9795 * @return null if the property has not been configured
98- * @throws ConfigurationException if the property is not a valid scalar long
96+ * @throws StructuredConfigException if the property is not a valid scalar long
9997 */
10098 @ Nullable
10199 Long getLong (String name );
@@ -105,7 +103,7 @@ default int getInt(String name, int defaultValue) {
105103 *
106104 * @return a {@link Long} configuration property or {@code defaultValue} if a property with {@code
107105 * name} has not been configured
108- * @throws ConfigurationException if the property is not a valid scalar long
106+ * @throws StructuredConfigException if the property is not a valid scalar long
109107 */
110108 default long getLong (String name , long defaultValue ) {
111109 return defaultIfNull (getLong (name ), defaultValue );
@@ -115,7 +113,7 @@ default long getLong(String name, long defaultValue) {
115113 * Returns a {@link Double} configuration property.
116114 *
117115 * @return null if the property has not been configured
118- * @throws ConfigurationException if the property is not a valid scalar double
116+ * @throws StructuredConfigException if the property is not a valid scalar double
119117 */
120118 @ Nullable
121119 Double getDouble (String name );
@@ -125,7 +123,7 @@ default long getLong(String name, long defaultValue) {
125123 *
126124 * @return a {@link Double} configuration property or {@code defaultValue} if a property with
127125 * {@code name} has not been configured
128- * @throws ConfigurationException if the property is not a valid scalar double
126+ * @throws StructuredConfigException if the property is not a valid scalar double
129127 */
130128 default double getDouble (String name , double defaultValue ) {
131129 return defaultIfNull (getDouble (name ), defaultValue );
@@ -139,8 +137,8 @@ default double getDouble(String name, double defaultValue) {
139137 * @param scalarType the scalar type, one of {@link String}, {@link Boolean}, {@link Long} or
140138 * {@link Double}
141139 * @return a {@link List} configuration property, or null if the property has not been configured
142- * @throws ConfigurationException if the property is not a valid sequence of scalars, or if {@code
143- * scalarType} is not supported
140+ * @throws StructuredConfigException if the property is not a valid sequence of scalars, or if
141+ * {@code scalarType} is not supported
144142 */
145143 @ Nullable
146144 <T > List <T > getScalarList (String name , Class <T > scalarType );
@@ -149,10 +147,12 @@ default double getDouble(String name, double defaultValue) {
149147 * Returns a {@link List} configuration property. Entries which are not strings are converted to
150148 * their string representation.
151149 *
152- * @see ConfigProperties#getList(String name)
150+ * @param name the property name
151+ * @param scalarType the scalar type, one of {@link String}, {@link Boolean}, {@link Long} or
152+ * {@link Double}
153153 * @return a {@link List} configuration property or {@code defaultValue} if a property with {@code
154154 * name} has not been configured
155- * @throws ConfigurationException if the property is not a valid sequence of scalars
155+ * @throws StructuredConfigException if the property is not a valid sequence of scalars
156156 */
157157 default <T > List <T > getScalarList (String name , Class <T > scalarType , List <T > defaultValue ) {
158158 return defaultIfNull (getScalarList (name , scalarType ), defaultValue );
@@ -163,7 +163,7 @@ default <T> List<T> getScalarList(String name, Class<T> scalarType, List<T> defa
163163 *
164164 * @return a map-valued configuration property, or {@code null} if {@code name} has not been
165165 * configured
166- * @throws ConfigurationException if the property is not a mapping
166+ * @throws StructuredConfigException if the property is not a mapping
167167 */
168168 @ Nullable
169169 StructuredConfigProperties getStructured (String name );
@@ -173,7 +173,7 @@ default <T> List<T> getScalarList(String name, Class<T> scalarType, List<T> defa
173173 *
174174 * @return a list of map-valued configuration property, or {@code null} if {@code name} has not
175175 * been configured
176- * @throws ConfigurationException if the property is not a sequence of mappings
176+ * @throws StructuredConfigException if the property is not a sequence of mappings
177177 */
178178 @ Nullable
179179 List <StructuredConfigProperties > getStructuredList (String name );
0 commit comments