Annotation Interface EnumLabel


@Retention(RUNTIME) @Target(FIELD) public @interface EnumLabel
Human-facing display label for a single @Enumeration constant, distinct from the Java constant name. Put it on the constant to localize or pretty-print the value (e.g. @EnumLabel("Новый") NEW) without renaming the constant — the name stays part of the data/API contract (it derives the value's stable UUID and is mirrored by importers and list filters), while the label is what users see.

Surfaces wherever an enum value is displayed: {column}_display in the read API, the label of each entry in an attribute's enumValues metadata, and the form dropdown. When absent (or empty), the display falls back to the constant name.

An optional color() paints the value as a colored pill — a status chip the colour of the spreadsheet cell it replaces — in list cells, the form dropdown, and the detail view. It rides the read API as {column}_color (next to {column}_display) and the color of each enumValues entry; the client derives a readable (dark/light) text colour from it. When absent the value renders as plain text, exactly as before.


 @Enumeration(name = "OrderStatuses", title = "Статусы заказов")
 public enum OrderStatus {
     @EnumLabel(value = "Новый", color = "#F4C7C3") NEW,
     @EnumLabel(value = "Отгружен", color = "#0B8043") SHIPPED
 }
 
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
     
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Optional badge colour for this value, as a CSS hex string ("#RRGGBB" or "#RGB").
  • Element Details

    • value

      String value
    • color

      String color
      Optional badge colour for this value, as a CSS hex string ("#RRGGBB" or "#RGB"). Drives a colored status pill wherever the value is shown. Empty (the default) renders plain text.
      Default:
      ""