io.quarkus.runtime.BannerRecorder Maven / Gradle / Ivy
The newest version!
package io.quarkus.runtime;
import java.util.Optional;
import java.util.function.Supplier;
import io.quarkus.runtime.annotations.Recorder;
@Recorder
public class BannerRecorder {
final RuntimeValue bannerRuntimeConfig;
public BannerRecorder(RuntimeValue bannerRuntimeConfig) {
this.bannerRuntimeConfig = bannerRuntimeConfig;
}
public RuntimeValue>> provideBannerSupplier(String bannerText) {
if (bannerRuntimeConfig.getValue().enabled) {
return new RuntimeValue<>(Optional.of(new ConstantSupplier(bannerText)));
}
return new RuntimeValue<>(Optional.empty());
}
private static final class ConstantSupplier implements Supplier {
private final String value;
public ConstantSupplier(String value) {
this.value = value;
}
@Override
public String get() {
return value;
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy