Bitmask Event Wrapper

Wrap an integer flag set handed up from a lower layer in a single-field value class exposing contains and containsAny, so call sites stop writing raw bitwise tests against library constants. Covers keeping the wrapper allocation-free, why the flag constants must travel with it, the difference between "any of these bits" and "all of these bits", and what happens when a non-flag constant is passed to a flag test. Use when the same bitwise expression is copied across call sites, when a flag test is written as an equality check, or when a wrapper type exists but nothing ever calls it.

maxrave-dev Updated 2.3k repo stars
The SimpMusic repository on GitHub

File contents

maxrave-dev/kotlin-footguns commit b8e3c937e5

Frequently asked questions

npx get-skill add maxrave-dev/bitmask-event-wrapper