Enum serialized form function generator.

Description

The Enums utilities already have a "serialized form" in which Identifier instances use kebab-case instead of upper SNAKE_CASE. When converting between this serialized form and the enum, it would be use useful instead of calling e.g. getSerializedEnum(final Class<E> enumType, String serializationName) to instead create a function based just upon the enum class. That way Stream and Optional pipelines could be very succinct; e.g.:

It's really just a minor convenience; the same thing could be done using:

Environment

None

Activity

Show:
Garret Wilson
May 12, 2020, 3:47 PM

There doesn't seem to be a need for a reverse mapping because Enums.getSerializationName(Enum<?> e) works directly off the enum instance anyway, so it can be used as a method reference.

Assignee

Garret Wilson

Reporter

Garret Wilson

Labels

None

Components

Fix versions

Priority

Minor
Configure