Skip to content

Commit

Permalink
Merge pull request #107 from sberyozkin/config_mapping
Browse files Browse the repository at this point in the history
Use ConfigMapping in the build time config
  • Loading branch information
sberyozkin authored Sep 19, 2024
2 parents 4aab854 + 81b14a7 commit 51b92bd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public static class IsEnabled implements BooleanSupplier {
FileVaultBuildTimeConfig config;

public boolean getAsBoolean() {
return config.enabled;
return config.enabled();
}
}
}
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
package io.quarkiverse.filevault.deployment;

import io.quarkus.runtime.annotations.ConfigItem;
import io.quarkus.runtime.annotations.ConfigPhase;
import io.quarkus.runtime.annotations.ConfigRoot;
import io.smallrye.config.ConfigMapping;
import io.smallrye.config.WithDefault;

/**
* Build time configuration for File Vault.
*/
@ConfigRoot(name = "file.vault")
public class FileVaultBuildTimeConfig {
@ConfigMapping(prefix = "quarkus.file.vault")
@ConfigRoot(phase = ConfigPhase.BUILD_TIME)
public interface FileVaultBuildTimeConfig {
/**
* If the File Vault extension is enabled.
*/
@ConfigItem(defaultValue = "true")
public boolean enabled;
@WithDefault("true")
boolean enabled();
}

0 comments on commit 51b92bd

Please sign in to comment.