Annotation Interface Key


The key of a record component, instead of the one converted from its name (maxBalance to max_balance): the config.toml key for ModConfig.bind(Class), the column name for ModStorage tables. A component keeps its key when it is renamed:
record Settings(@Key("max_hp_regen") int healthRegenPerHour) {}
The key is snake_case: lowercase letters, digits, and single underscores, starting with a letter. Two components of a record cannot have the same key. For a storage record, giving an existing component another key renames its column, which the table treats as a removed and a new column, as when the component is renamed without @Key.
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
     
  • Element Details