All Downloads are FREE. Search and download functionalities are using the official Maven repository.

xyz.block.ftl.deployment.RetryRecord Maven / Gradle / Ivy

There is a newer version: 0.398.1
Show newest version
package xyz.block.ftl.deployment;

import org.jboss.jandex.AnnotationInstance;

public record RetryRecord(int count, String minBackoff, String maxBackoff, String catchModule, String catchVerb) {

    public static RetryRecord fromJandex(AnnotationInstance nested, String currentModuleName) {
        return new RetryRecord(
                nested.value("count") != null ? nested.value("count").asInt() : 0,
                nested.value("minBackoff") != null ? nested.value("minBackoff").asString() : "",
                nested.value("maxBackoff") != null ? nested.value("maxBackoff").asString() : "",
                nested.value("catchModule") != null ? nested.value("catchModule").asString() : currentModuleName,
                nested.value("catchVerb") != null ? nested.value("catchVerb").asString() : "");
    }

    public boolean isEmpty() {
        return count == 0 && minBackoff.isEmpty() && maxBackoff.isEmpty() && catchVerb.isEmpty();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy