<commit_before>package io.github.resilience4j.decorators;

import io.github.resilience4j.bulkhead.Bulkhead;
import io.github.resilience4j.bulkhead.ThreadPoolBulkhead;
import io.github.resilience4j.cache.Cache;
import io.github.resilience4j.circuitbreaker.CircuitBreaker;
import io.github.resilience4j.core.CallableUtils;
import io.github.resilience4j.core.CheckFunctionUtils;
import io.github.resilience4j.core.CompletionStageUtils;
import io.github.resilience4j.core.SupplierUtils;
import io.github.resilience4j.ratelimiter.RateLimiter;
import io.github.resilience4j.retry.Retry;
import io.github.resilience4j.timelimiter.TimeLimiter;
import io.vavr.CheckedFunction0;
import io.vavr.CheckedFunction1;
import io.vavr.CheckedFunction2;
import io.vavr.CheckedRunnable;

import java.util.List;
import java.util.concurrent.Callable;
import java.util.concurrent.CompletionStage;
import java.util.concurrent.ScheduledExecutorService;
import java.util.function.*;

/**
 * A Decorator builder which can be used to apply multiple decorators to a Supplier, Callable
 * Function, Runnable, CompletionStage or Consumer.
 * <p></p>
 * Decorators are applied in the order of the builder chain. For example, consider:
 *
 * <pre>{@code
 * Supplier<String> supplier = Decorators
 *     .ofSupplier(() -> service.method())
 *     .withCircuitBreaker(CircuitBreaker.ofDefaults("id"))
 *     .withRetry(Retry.ofDefaults("id"))
 *     .withFallback(CallNotPermittedException.class, e -> service.fallbackMethod())
 *     .decorate();
 * }</pre>
 *
 * This results in the following composition when executing the supplier: <br/>
 * <pre>Fallback(Retry(CircuitBreaker(Supplier)))</pre>
 *
 * This means the Supplier is called first, then it’s result is handled by the CircuitBreaker, then Retry and then Fallback.
 * Each Decorator makes its own determination whether an exception represents a failure.
 */<commit_msg>Delete self-closing element in javadoc (#833)<commit_after>package io.github.resilience4j.decorators;

import io.github.resilience4j.bulkhead.Bulkhead;
import io.github.resilience4j.bulkhead.ThreadPoolBulkhead;
import io.github.resilience4j.cache.Cache;
import io.github.resilience4j.circuitbreaker.CircuitBreaker;
import io.github.resilience4j.core.CallableUtils;
import io.github.resilience4j.core.CheckFunctionUtils;
import io.github.resilience4j.core.CompletionStageUtils;
import io.github.resilience4j.core.SupplierUtils;
import io.github.resilience4j.ratelimiter.RateLimiter;
import io.github.resilience4j.retry.Retry;
import io.github.resilience4j.timelimiter.TimeLimiter;
import io.vavr.CheckedFunction0;
import io.vavr.CheckedFunction1;
import io.vavr.CheckedFunction2;
import io.vavr.CheckedRunnable;

import java.util.List;
import java.util.concurrent.Callable;
import java.util.concurrent.CompletionStage;
import java.util.concurrent.ScheduledExecutorService;
import java.util.function.*;

/**
 * A Decorator builder which can be used to apply multiple decorators to a Supplier, Callable
 * Function, Runnable, CompletionStage or Consumer.
 * <p></p>
 * Decorators are applied in the order of the builder chain. For example, consider:
 *
 * <pre>{@code
 * Supplier<String> supplier = Decorators
 *     .ofSupplier(() -> service.method())
 *     .withCircuitBreaker(CircuitBreaker.ofDefaults("id"))
 *     .withRetry(Retry.ofDefaults("id"))
 *     .withFallback(CallNotPermittedException.class, e -> service.fallbackMethod())
 *     .decorate();
 * }</pre>
 *
 * This results in the following composition when executing the supplier: <br>
 * <pre>Fallback(Retry(CircuitBreaker(Supplier)))</pre>
 *
 * This means the Supplier is called first, then it’s result is handled by the CircuitBreaker, then Retry and then Fallback.
 * Each Decorator makes its own determination whether an exception represents a failure.
 */
{'fraction_non_alphanumeric': 0.10599319549856058, 'fraction_numerical': 0.008636482596179012, 'mean_word_length': 5.522184300341297, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6544408', 'n_tokens_mistral': 1225, 'n_tokens_neox': 1207, 'n_words': 271}