com.giffing.bucket4j.spring.boot.starter.context.RateLimitResultWrapper Maven / Gradle / Ivy
The newest version!
package com.giffing.bucket4j.spring.boot.starter.context;
import lombok.Data;
import java.util.concurrent.CompletableFuture;
/**
* A wrapper class to distinguish the {@link RateLimiting} result between a synchronous and asynchronous call.
*
* If possible we should get rid of it...
*/
@Data
public class RateLimitResultWrapper {
private RateLimitResult rateLimitResult;
private CompletableFuture rateLimitResultCompletableFuture;
public RateLimitResultWrapper(RateLimitResult rateLimitResult) {
this.rateLimitResult = rateLimitResult;
}
public RateLimitResultWrapper(CompletableFuture rateLimitResultCompletableFuture) {
this.rateLimitResultCompletableFuture = rateLimitResultCompletableFuture;
}
}