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

io.github.icodegarden.nutrient.lang.limiter.CompositeRateLimiter Maven / Gradle / Ivy

The newest version!
package io.github.icodegarden.nutrient.lang.limiter;

import java.util.List;

/**
 * 
 * @author Fangfang.Xu
 *
 */
public class CompositeRateLimiter implements RateLimiter {

	private final List rateLimiters;

	public CompositeRateLimiter(List rateLimiters) {
		this.rateLimiters = rateLimiters;
	}

	@Override
	public boolean isAllowable(int weight) {
		return rateLimiters.stream().allMatch(rateLimiter -> {
			return rateLimiter.isAllowable(weight);
		});
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy