Reformat code comments for consistency and clarity across all classes
This commit is contained in:
@@ -1,12 +1,6 @@
|
||||
package dev.coph.nextusweb.server.ratelimit;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.IdentityHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* Immutable mapping from request paths to the {@link Rule rate-limit rules} that apply to them.
|
||||
@@ -24,13 +18,21 @@ import java.util.Set;
|
||||
*/
|
||||
public final class RateLimitConfig {
|
||||
|
||||
/** Rule applied to every request, or {@code null} if no global rule is configured. */
|
||||
/**
|
||||
* Rule applied to every request, or {@code null} if no global rule is configured.
|
||||
*/
|
||||
private final Rule globalRule;
|
||||
/** Rules matched by exact path equality, keyed by path. */
|
||||
/**
|
||||
* Rules matched by exact path equality, keyed by path.
|
||||
*/
|
||||
private final Map<String, Rule> exactPathRules;
|
||||
/** Prefix rules, pre-sorted longest-prefix-first so the most specific match wins. */
|
||||
/**
|
||||
* Prefix rules, pre-sorted longest-prefix-first so the most specific match wins.
|
||||
*/
|
||||
private final List<PrefixRule> prefixRules;
|
||||
/** Every distinct limiter referenced by any rule, by identity; used for periodic cleanup. */
|
||||
/**
|
||||
* Every distinct limiter referenced by any rule, by identity; used for periodic cleanup.
|
||||
*/
|
||||
private final Set<RateLimiter> allLimiters;
|
||||
|
||||
/**
|
||||
@@ -124,11 +126,17 @@ public final class RateLimitConfig {
|
||||
* Fluent builder for {@link RateLimitConfig}.
|
||||
*/
|
||||
public static final class Builder {
|
||||
/** Accumulated exact-path rules, keyed by path. */
|
||||
/**
|
||||
* Accumulated exact-path rules, keyed by path.
|
||||
*/
|
||||
private final Map<String, Rule> exactPathRules = new HashMap<>();
|
||||
/** Accumulated prefix rules. */
|
||||
/**
|
||||
* Accumulated prefix rules.
|
||||
*/
|
||||
private final List<PrefixRule> prefixRules = new ArrayList<>();
|
||||
/** The global rule, if configured. */
|
||||
/**
|
||||
* The global rule, if configured.
|
||||
*/
|
||||
private Rule globalRule;
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user