Now Genum is out!
Using Genum CLI tool, you can generate Enum java file from YAML file.
For example, there is cities.yml
$ cat cities.yml
- Tokyo
- NewYork
- London
- Beijing
- Paris
- Roma
$ ./bin/genus-cli -c City -p com.example -s cities.yml -o your/project/src/main/java
$ cat your/project/src/main/java/com/example/City.java
package com.example;
public enum City {
TOKYO,
NEW_YORK,
LONDON,
BEIJING,
PARIS,
ROMA
}
You can share definition between server side and client side easily 😄 🙌