Java: Convert enum to and from string

enum → String

yourEnum.name()

String → enum

YourEnum.valueOf(yourString)

Comments

Be the first to comment!