The sequence of values for your Enum.
The sequence of values for your Enum. You will typically want
to implement this in your extending class as a val
so that withName
and friends are as efficient as possible.
Feel free to implement this however you'd like (including messing around with ordering, etc) if that fits your needs better.
Method that returns a Seq of A objects that the macro was able to find.
Method that returns a Seq of A objects that the macro was able to find.
You will want to use this in some way to implement your values method. In fact, if you aren't using this method...why are you even bothering with this lib?
Returns the index number of the member passed in the values picked up by this enum
Returns the index number of the member passed in the values picked up by this enum
the member you want to check the index of
the index of the first element of values that is equal (as determined by ==) to member, or -1, if none exists.
Map of A object names in lower case to As for case-insensitive comparison
Map of A object names to As
Map of A to their index in the values sequence.
Map of A to their index in the values sequence.
A performance optimisation so that indexOf can be found in constant time.
Tries to get an A by the supplied name.
Tries to get an A by the supplied name. The name corresponds to the .name of the case objects implementing A
Like Enumeration's withName
, this method will throw if the name does not match any of the values'
.entryName values.
Tries to get an A by the supplied name.
Tries to get an A by the supplied name. The name corresponds to the .name of the case objects implementing A, disregarding case
Like Enumeration's withName
, this method will throw if the name does not match any of the values'
.entryName values.
Optionally returns an A for a given name, disregarding case
Optionally returns an A for a given name.
All the cool kids have their own Enumeration implementation, most of which try to do so in the name of implementing exhaustive pattern matching.
This is yet another one.
How to use:
The sealed trait