1212import javax .annotation .Nullable ;
1313
1414/**
15- * An interface for accessing structured configuration data.
15+ * An interface for accessing declarative configuration data.
1616 *
17- * <p>An instance of {@link StructuredConfigProperties } is equivalent to a <a
17+ * <p>An instance of {@link DeclarativeConfigProperties } is equivalent to a <a
1818 * href="https://yaml.org/spec/1.2.2/#3211-nodes">YAML mapping node</a>. It has accessors for
1919 * reading scalar properties, {@link #getStructured(String)} for reading children which are
2020 * themselves mappings, and {@link #getStructuredList(String)} for reading children which are
2121 * sequences of mappings.
2222 */
23- public interface StructuredConfigProperties {
23+ public interface DeclarativeConfigProperties {
2424
2525 /**
2626 * Returns a {@link String} configuration property.
2727 *
2828 * @return null if the property has not been configured
29- * @throws StructuredConfigException if the property is not a valid scalar string
29+ * @throws DeclarativeConfigException if the property is not a valid scalar string
3030 */
3131 @ Nullable
3232 String getString (String name );
@@ -36,7 +36,7 @@ public interface StructuredConfigProperties {
3636 *
3737 * @return a {@link String} configuration property or {@code defaultValue} if a property with
3838 * {@code name} has not been configured
39- * @throws StructuredConfigException if the property is not a valid scalar string
39+ * @throws DeclarativeConfigException if the property is not a valid scalar string
4040 */
4141 default String getString (String name , String defaultValue ) {
4242 return defaultIfNull (getString (name ), defaultValue );
@@ -47,7 +47,7 @@ default String getString(String name, String defaultValue) {
4747 * {@link Boolean#parseBoolean(String)} for handling the values.
4848 *
4949 * @return null if the property has not been configured
50- * @throws StructuredConfigException if the property is not a valid scalar boolean
50+ * @throws DeclarativeConfigException if the property is not a valid scalar boolean
5151 */
5252 @ Nullable
5353 Boolean getBoolean (String name );
@@ -57,7 +57,7 @@ default String getString(String name, String defaultValue) {
5757 *
5858 * @return a {@link Boolean} configuration property or {@code defaultValue} if a property with
5959 * {@code name} has not been configured
60- * @throws StructuredConfigException if the property is not a valid scalar boolean
60+ * @throws DeclarativeConfigException if the property is not a valid scalar boolean
6161 */
6262 default boolean getBoolean (String name , boolean defaultValue ) {
6363 return defaultIfNull (getBoolean (name ), defaultValue );
@@ -70,7 +70,7 @@ default boolean getBoolean(String name, boolean defaultValue) {
7070 * {@link Long#intValue()} which may result in loss of precision.
7171 *
7272 * @return null if the property has not been configured
73- * @throws StructuredConfigException if the property is not a valid scalar integer
73+ * @throws DeclarativeConfigException if the property is not a valid scalar integer
7474 */
7575 @ Nullable
7676 Integer getInt (String name );
@@ -83,7 +83,7 @@ default boolean getBoolean(String name, boolean defaultValue) {
8383 *
8484 * @return a {@link Integer} configuration property or {@code defaultValue} if a property with
8585 * {@code name} has not been configured
86- * @throws StructuredConfigException if the property is not a valid scalar integer
86+ * @throws DeclarativeConfigException if the property is not a valid scalar integer
8787 */
8888 default int getInt (String name , int defaultValue ) {
8989 return defaultIfNull (getInt (name ), defaultValue );
@@ -93,7 +93,7 @@ default int getInt(String name, int defaultValue) {
9393 * Returns a {@link Long} configuration property.
9494 *
9595 * @return null if the property has not been configured
96- * @throws StructuredConfigException if the property is not a valid scalar long
96+ * @throws DeclarativeConfigException if the property is not a valid scalar long
9797 */
9898 @ Nullable
9999 Long getLong (String name );
@@ -103,7 +103,7 @@ default int getInt(String name, int defaultValue) {
103103 *
104104 * @return a {@link Long} configuration property or {@code defaultValue} if a property with {@code
105105 * name} has not been configured
106- * @throws StructuredConfigException if the property is not a valid scalar long
106+ * @throws DeclarativeConfigException if the property is not a valid scalar long
107107 */
108108 default long getLong (String name , long defaultValue ) {
109109 return defaultIfNull (getLong (name ), defaultValue );
@@ -113,7 +113,7 @@ default long getLong(String name, long defaultValue) {
113113 * Returns a {@link Double} configuration property.
114114 *
115115 * @return null if the property has not been configured
116- * @throws StructuredConfigException if the property is not a valid scalar double
116+ * @throws DeclarativeConfigException if the property is not a valid scalar double
117117 */
118118 @ Nullable
119119 Double getDouble (String name );
@@ -123,7 +123,7 @@ default long getLong(String name, long defaultValue) {
123123 *
124124 * @return a {@link Double} configuration property or {@code defaultValue} if a property with
125125 * {@code name} has not been configured
126- * @throws StructuredConfigException if the property is not a valid scalar double
126+ * @throws DeclarativeConfigException if the property is not a valid scalar double
127127 */
128128 default double getDouble (String name , double defaultValue ) {
129129 return defaultIfNull (getDouble (name ), defaultValue );
@@ -137,7 +137,7 @@ default double getDouble(String name, double defaultValue) {
137137 * @param scalarType the scalar type, one of {@link String}, {@link Boolean}, {@link Long} or
138138 * {@link Double}
139139 * @return a {@link List} configuration property, or null if the property has not been configured
140- * @throws StructuredConfigException if the property is not a valid sequence of scalars, or if
140+ * @throws DeclarativeConfigException if the property is not a valid sequence of scalars, or if
141141 * {@code scalarType} is not supported
142142 */
143143 @ Nullable
@@ -152,31 +152,31 @@ default double getDouble(String name, double defaultValue) {
152152 * {@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 StructuredConfigException if the property is not a valid sequence of scalars
155+ * @throws DeclarativeConfigException 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 );
159159 }
160160
161161 /**
162- * Returns a {@link StructuredConfigProperties } configuration property.
162+ * Returns a {@link DeclarativeConfigProperties } configuration property.
163163 *
164164 * @return a map-valued configuration property, or {@code null} if {@code name} has not been
165165 * configured
166- * @throws StructuredConfigException if the property is not a mapping
166+ * @throws DeclarativeConfigException if the property is not a mapping
167167 */
168168 @ Nullable
169- StructuredConfigProperties getStructured (String name );
169+ DeclarativeConfigProperties getStructured (String name );
170170
171171 /**
172- * Returns a list of {@link StructuredConfigProperties } configuration property.
172+ * Returns a list of {@link DeclarativeConfigProperties } configuration property.
173173 *
174174 * @return a list of map-valued configuration property, or {@code null} if {@code name} has not
175175 * been configured
176- * @throws StructuredConfigException if the property is not a sequence of mappings
176+ * @throws DeclarativeConfigException if the property is not a sequence of mappings
177177 */
178178 @ Nullable
179- List <StructuredConfigProperties > getStructuredList (String name );
179+ List <DeclarativeConfigProperties > getStructuredList (String name );
180180
181181 /**
182182 * Returns a set of all configuration property keys.
0 commit comments