forked from redhat-developer/intellij-quarkus
-
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.
fix: support old ConfigPhase.BOOTSRAP + enum like ConfigPhase.BOOTSRAP
Signed-off-by: azerr <[email protected]>
- Loading branch information
1 parent
32d3e65
commit 226177a
Showing
4 changed files
with
80 additions
and
6 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
66 changes: 66 additions & 0 deletions
66
src/main/java/com/redhat/microprofile/psi/internal/quarkus/core/properties/ConfigPhase.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,66 @@ | ||
package com.redhat.microprofile.psi.internal.quarkus.core.properties; | ||
|
||
/** | ||
* Copy/Paste from ConfigPhase from Quarkus IO to support | ||
* old Quarkus application which defined BOOTSRAP which was removed | ||
* in the new version of Quarkus. | ||
*/ | ||
public enum ConfigPhase { | ||
/** | ||
* Values are read and available for usage at build time. | ||
*/ | ||
BUILD_TIME(true, false, false, "Build time"), | ||
/** | ||
* Values are read and available for usage at build time, and available on a read-only basis at run time. | ||
*/ | ||
BUILD_AND_RUN_TIME_FIXED(true, true, false, "Build time and run time fixed"), | ||
|
||
/** | ||
* Values are read and available for usage at run time and are re-read on each program execution. These values | ||
* are used to configure ConfigSourceProvider implementations | ||
* | ||
* @deprecated Please use {@link io.smallrye.config.ConfigSourceFactory.ConfigurableConfigSourceFactory} and | ||
* register it in a {@link io.quarkus.runtime.configuration.ConfigBuilder}. | ||
*/ | ||
@Deprecated | ||
BOOTSTRAP(false, true, true, "Bootstrap"), | ||
|
||
/** | ||
* Values are read and available for usage at run time and are re-read on each program execution. | ||
*/ | ||
RUN_TIME(false, true, true, "Run time"), | ||
; | ||
|
||
private final boolean availableAtBuild; | ||
private final boolean availableAtRun; | ||
private final boolean readAtMain; | ||
private final String name; | ||
|
||
ConfigPhase(final boolean availableAtBuild, final boolean availableAtRun, final boolean readAtMain, final String name) { | ||
this.availableAtBuild = availableAtBuild; | ||
this.availableAtRun = availableAtRun; | ||
this.readAtMain = readAtMain; | ||
this.name = name; | ||
} | ||
|
||
public boolean isAvailableAtBuild() { | ||
return availableAtBuild; | ||
} | ||
|
||
public boolean isAvailableAtRun() { | ||
return availableAtRun; | ||
} | ||
|
||
public boolean isReadAtStaticInit() { | ||
return isAvailableAtBuild() && isAvailableAtRun(); | ||
} | ||
|
||
public boolean isReadAtMain() { | ||
return readAtMain; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return name; | ||
} | ||
} |
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