This feature / enhancement was to add some object oriented style programming / human readable with
what is normally bit-wise permissions using a integer to hold all the bits that represent some flag based on its bit-place which in turn is a value that is "|" ORed with the single integer containing all the flags.
Added
Flags interface with one single method int get() and helper methods for checking flags
as well as retrieving them for human readable viewing in the interface
Each class that held int constants representing a flag now has a Type subclass
which is an enum that implements Flag
Test cases were added. The test will make sure the Flags methods are working and do a reverse lookup and make sure that the developer did not miss any permissions mirroring in the Type class.
Notes: All classes that have flags must have matching Type to pass, all flags must be mappable to a class containing the flag constant. Test case performance/design was to provide simplicity in copy - pasta. A Nothing field was added to all classes that did not have a int Nothing = 0; to ensure uniformity between flags that did not have a None. Default or Nothing already.
Closes #37.
This feature / enhancement was to add some object oriented style programming / human readable with what is normally bit-wise permissions using a integer to hold all the bits that represent some flag based on its bit-place which in turn is a value that is "|" ORed with the single integer containing all the flags.
Added
int get()
and helper methods for checking flags as well as retrieving them for human readable viewing in the interfaceNotes: All classes that have flags must have matching Type to pass, all flags must be mappable to a class containing the flag constant. Test case performance/design was to provide simplicity in copy - pasta. A Nothing field was added to all classes that did not have a
int Nothing = 0;
to ensure uniformity between flags that did not have a None. Default or Nothing already.