forked from eclipse/ConfigJSR
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refs: eclipse#9 rename ConfigValue to ConfigAccessor
as discussed in the EG meeting Signed-off-by: Mark Struberg <[email protected]>
- Loading branch information
Showing
7 changed files
with
42 additions
and
42 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
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 |
---|---|---|
|
@@ -45,7 +45,7 @@ | |
* @author <a href="mailto:[email protected]">Mark Struberg</a> | ||
* @author <a href="mailto:[email protected]">Gerhard Petracek</a> | ||
*/ | ||
public interface ConfigValue<T> { | ||
public interface ConfigAccessor<T> { | ||
|
||
/** | ||
* Sets the type of the configuration entry to the given class and returns this builder. | ||
|
@@ -66,7 +66,7 @@ public interface ConfigValue<T> { | |
* @param <N> The target type | ||
* @return This builder as a typed ConfigValue | ||
*/ | ||
<N> ConfigValue<N> as(Class<N> clazz); | ||
<N> ConfigAccessor<N> as(Class<N> clazz); | ||
|
||
/** | ||
* Declare the ConfigValue to return a List of the given Type. | ||
|
@@ -77,38 +77,38 @@ public interface ConfigValue<T> { | |
* | ||
* @return a ConfigValue for a list of configured comma separated values | ||
*/ | ||
ConfigValue<List<T>> asList(); | ||
ConfigAccessor<List<T>> asList(); | ||
|
||
/** | ||
* Declare the ConfigValue to return a Set of the given Type. | ||
* The notation and escaping rules are the same like explained in {@link #asList()} | ||
* | ||
* @return a ConfigValue for a list of configured comma separated values | ||
*/ | ||
ConfigValue<Set<T>> asSet(); | ||
ConfigAccessor<Set<T>> asSet(); | ||
|
||
/** | ||
* Defines a {@link Converter} to be used instead of the default Converter resolving logic. | ||
* | ||
* @param converter The converter for the target type | ||
* @return This builder as a typed ConfigValue | ||
*/ | ||
ConfigValue<T> useConverter(Converter<T> converter); | ||
ConfigAccessor<T> useConverter(Converter<T> converter); | ||
|
||
/** | ||
* Sets the default value to use in case the resolution returns null. | ||
* @param value the default value | ||
* @return This builder | ||
*/ | ||
ConfigValue<T> withDefault(T value); | ||
ConfigAccessor<T> withDefault(T value); | ||
|
||
/** | ||
* Sets the default value to use in case the resolution returns null. Converts the given String to the type of | ||
* this resolver using the same method as used for the configuration entries. | ||
* @param value string value to be converted and used as default | ||
* @return This builder | ||
*/ | ||
ConfigValue<T> withStringDefault(String value); | ||
ConfigAccessor<T> withStringDefault(String value); | ||
|
||
/** | ||
* Specify that a resolved value will get cached for a certain maximum amount of time. | ||
|
@@ -124,7 +124,7 @@ public interface ConfigValue<T> { | |
* @param timeUnit the TimeUnit for the value | ||
* @return This builder | ||
*/ | ||
ConfigValue<T> cacheFor(long value, TimeUnit timeUnit); | ||
ConfigAccessor<T> cacheFor(long value, TimeUnit timeUnit); | ||
|
||
/** | ||
* Whether to evaluate variables in configured values. | ||
|
@@ -139,7 +139,7 @@ public interface ConfigValue<T> { | |
* @param evaluateVariables whether to evaluate variables in values or not | ||
* @return This builder | ||
*/ | ||
ConfigValue<T> evaluateVariables(boolean evaluateVariables); | ||
ConfigAccessor<T> evaluateVariables(boolean evaluateVariables); | ||
|
||
/** | ||
* Appends the resolved value of the given property to the key of this builder. | ||
|
@@ -169,7 +169,7 @@ public interface ConfigValue<T> { | |
* | ||
* @return This builder | ||
*/ | ||
ConfigValue<T> withLookupChain(String... postfixNames); | ||
ConfigAccessor<T> withLookupChain(String... postfixNames); | ||
|
||
/** | ||
* Returns the converted resolved filtered value. | ||
|
@@ -184,11 +184,11 @@ public interface ConfigValue<T> { | |
/** | ||
* Returns the value from a previously taken {@link ConfigSnapshot}. | ||
* | ||
* @param configSnapshot previously taken via {@link Config#snapshotFor(ConfigValue[])} | ||
* @param configSnapshot previously taken via {@link Config#snapshotFor(ConfigAccessor[])} | ||
* @return the resolved Value | ||
* @see Config#snapshotFor(ConfigValue[]) | ||
* @see Config#snapshotFor(ConfigAccessor[]) | ||
* @throws IllegalArgumentException if the {@link ConfigSnapshot} hasn't been resolved | ||
* for this {@link ConfigValue} | ||
* for this {@link ConfigAccessor} | ||
*/ | ||
T getValue(ConfigSnapshot configSnapshot); | ||
|
||
|
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 |
---|---|---|
|
@@ -27,10 +27,10 @@ | |
package javax.config; | ||
|
||
/** | ||
* A value holder for TypedResolver values which all got resolved in a guaranteed atomic way. | ||
* A value holder for ConfigAccessor values which all got resolved in a guaranteed atomic way. | ||
* | ||
* @see Config#snapshotFor(ConfigValue[]) | ||
* @see ConfigValue#getValue(ConfigSnapshot) | ||
* @see Config#snapshotFor(ConfigAccessor[]) | ||
* @see ConfigAccessor#getValue(ConfigSnapshot) | ||
* | ||
* @author <a href="mailto:[email protected]">Mark Struberg</a> | ||
* @author Manfred Huber | ||
|
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
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