Java: Convert enum to and from string

enum → String

yourEnum.name()

String → enum

YourEnum.valueOf(yourString)

Comments