- Performance characteristics are similar to the Java's EnumSet.
- More efficient with
Enum
types that have less than or equal to 64 values. - Static factory methods similar to the Java version are provided:
EnumSet.Of(Bird.Stork, ...)
-
Enum
constants defined with the same value are treated as aliases:public enum Bird { BlueJay, // 0 Stork, // 1 Puffin, // 2 SeaParrot = 2, // 2 Chicken // 3 } var a = EnumSet.Of(Bird.SeaParrot); var b = EnumSet.Of(Bird.Puffin) Assert.That(a, Is.EqualTo(b)));
-
When creating an empty
EnumSet
, you must specify the type:var a = EnumSet.Of<Bird>()