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

com.netflix.concurrency.limits.limit.FixedLimit Maven / Gradle / Ivy

package com.netflix.concurrency.limits.limit;

import com.netflix.concurrency.limits.Limit;

/**
 * Non dynamic limit with fixed value
 */
public final class FixedLimit implements Limit {

    private final int limit;

    public static FixedLimit of(int limit) {
        return new FixedLimit(limit);
    }
    
    private FixedLimit(int limit) {
        this.limit = limit;
    }
    
    @Override
    public int getLimit() {
        return limit;
    }

    @Override
    public void update(SampleWindow sample) {
    }
    
    @Override
    public String toString() {
        return "FixedLimit [limit=" + limit + "]";
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy