Encodes a feature flag, stored as a Long
.
Encodes a feature flag, stored as a Long
.
Note that feature flags should be powers of 2, because they'll get added to the set via bitwise arithmetic.
Example:
val RED = Features.flag(1) val GREEN = Features.flag(2) val BLUE = Features.flag(4) val WHITE = Features.flag(8)
You can wrap a Long
into a Flag
via flag.
Encoding for the newtype we're defining,
used to make Flag and
Flags type safe (instead of usage of
Long
), but without the boxing.
Encoding for the newtype we're defining,
used to make Flag and
Flags type safe (instead of usage of
Long
), but without the boxing.
Inspired by the alexknvl/newtypes project.
Encodes a set of Flag values.
Encodes a set of Flag values.
Internally this is still a Long
, but has its own type for
type safety reasons.
Encoding for the newtype we're defining,
used to make Flag and
Flags type safe (instead of usage of
Long
), but without the boxing.
Encoding for the newtype we're defining,
used to make Flag and
Flags type safe (instead of usage of
Long
), but without the boxing.
Inspired by the alexknvl/newtypes project.
Builds a new Features instance.
Builds a new Features instance.
is a list of feature flags to instantiate the value with.
Reusable, empty Features reference.
Wraps a Long
value into a Flag.
Wraps a Long
value into a Flag.