Class ReasonCounterSet
java.lang.Object
ai.attackframework.tools.burp.utils.ReasonCounterSet
Thread-safe map-of-counters keyed by a short reason label.
Used wherever we want a small, reason-coded event tally (silent skips, traffic drops,
...). Keys are trimmed; null, blank, or non-positive counts are ignored so that
hot-path callers do not need to guard each call. Snapshots are returned in a deterministic
key order so the UI can render stable rows.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Removes all counters.longReturns the counter forreason, or0when the key is absent or invalid.voidAddscountto the counter forreason; ignored when inputs are invalid.snapshot()Returns a sorted-by-key snapshot of the counters.longtotal()Returns the sum across every counter; zero when the set is empty.
-
Constructor Details
-
ReasonCounterSet
public ReasonCounterSet()
-
-
Method Details
-
record
Addscountto the counter forreason; ignored when inputs are invalid. -
get
Returns the counter forreason, or0when the key is absent or invalid. -
snapshot
Returns a sorted-by-key snapshot of the counters. The returned map is a live copy and may be iterated without synchronization; later updates are not reflected. -
total
public long total()Returns the sum across every counter; zero when the set is empty. -
clear
public void clear()Removes all counters.
-