/** * Creates an instance where the {@code toString} method is written manually. * <p> * The {@code toString} method is called to extract the correct formatted string. * * @param <T> the type of the enum * @param enumType the type of the enum * @return the names instance */ public static <T extends Enum<T> & NamedEnum> EnumNames<T> ofManualToString(Class<T> enumType) { return new EnumNames<>(enumType, true); }
/** * Creates an instance deriving the formatted string from the enum constant name. * * @param <T> the type of the enum * @param enumType the type of the enum * @return the names instance */ public static <T extends Enum<T> & NamedEnum> EnumNames<T> of(Class<T> enumType) { return new EnumNames<>(enumType, false); }