Use formatter-maven-plugin to automatically format the enum code.
public enum Answer {
  YES(1),NO(2),MAYBE(3);
}
public enum Answer {
  YES(1),
  NO(2),
  MAYBE(3);
}
The above format could be applied by setting the value of ʻalignment_for_enum_constantsin the configuration file (xml) to49`.
    <setting id="org.eclipse.jdt.core.formatter.alignment_for_enum_constants" value="49"/>
        Recommended Posts