Thanks for the comments guys.

On Mon, Feb 13, 2012 at 11:51 PM, Blake Sullivan
<[email protected]> wrote:
> Overloaded how?
>
> The other question is that we want to be able to go from the
> displayName->Enum

Actually, this is the only question. :-)

We've already got an "accessor" - the Accessibility enum overrides
toString() to return the display name/pretty name/alias that gets
passed in when the constant is created.

What I need is a way to map back from the toString() value to the
corresponding enum constant.  For this, we should follow the pattern
set by Enum.valueOf().  So, we'll want something like:

Accessibility.valueOfTheStringThatGetsReturnedFromToStringNotTheEnumConstantName()

But shorter.

Maybe:

- valueOfDisplayName()?  Or...
- valueOfAlias()?

Whatever name we come up with, I will:

- Update the name of the Accessibility enum constant constructor
argument to match.
- Add javadoc to toString() that clarifies that it returns the display
name/alias/whatever we call it.

Andy

Reply via email to