-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rename Property Plugin from PropertyRequiresPlugin to ConfigPropertyP…
…lugin (#572) * start * fix tests * deprecated * bump plugin * versions * format * Update ExternalProvider.java * format? * revert property plugin change * Revert "revert property plugin change" This reverts commit cf9f166. * Rename PropertyPlugin * Update PropertyRequiresPlugin.java * Update ExternalProvider.java * update gradle plugin * revert config prop change * Update PropertyRequiresPlugin.java * Update DBeanScopeBuilder.java * move methods back how they were * Cleanup * fix conflict * fix conflicts * Update pom.xml * Update pom.xml * ConfigPropertyPlugin extends InjectExtension * Rename internal field names to propertyPlugin and fix javadoc --------- Co-authored-by: Rob Bygrave <[email protected]> Co-authored-by: Rob Bygrave <[email protected]>
- Loading branch information
1 parent
47772bd
commit 1bf404c
Showing
13 changed files
with
102 additions
and
40 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
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
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
39 changes: 39 additions & 0 deletions
39
inject/src/main/java/io/avaje/inject/spi/ConfigPropertyPlugin.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,39 @@ | ||
package io.avaje.inject.spi; | ||
|
||
import java.util.Optional; | ||
|
||
import io.avaje.lang.NonNullApi; | ||
|
||
/** | ||
* InjectPlugin interface which contains the application properties used for wiring. Used with | ||
* {@link io.avaje.inject.RequiresProperty} and {@link io.avaje.inject.Profile}. | ||
* | ||
* <p>The plugin is loaded via ServiceLoader and defaults to an implementation that uses {@link | ||
* System#getProperty(String)} and {@link System#getenv(String)}. | ||
*/ | ||
@NonNullApi | ||
public interface ConfigPropertyPlugin extends InjectExtension, PropertyRequiresPlugin { | ||
|
||
/** | ||
* Return a configuration value that might not exist. | ||
*/ | ||
Optional<String> get(String property); | ||
|
||
/** | ||
* Return true if the property is defined. | ||
*/ | ||
boolean contains(String property); | ||
|
||
/** Return true if the property is not defined. */ | ||
default boolean missing(String property) { | ||
return !contains(property); | ||
} | ||
|
||
/** Return true if the property is equal to the given value. */ | ||
boolean equalTo(String property, String value); | ||
|
||
/** Return true if the property is not defined or not equal to the given value. */ | ||
default boolean notEqualTo(String property, String value) { | ||
return !equalTo(property, value); | ||
} | ||
} |
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