Package arez.persist

Annotation Interface Persist


@Documented @Target(METHOD) public @interface Persist
Annotation applied to observable properties that direct Arez to persist the property.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Return the name used to persist the property.
    Return the name of the setter.
    The key identifying the store where the observable data is stored.
  • Element Details

    • name

      @Nonnull String name
      Return the name used to persist the property. If unspecified and the method is named according to javabeans getter conventions then the java bean property name will be used, otherwise the name of the method will be used. It should be notes that during the code generation the name will also be used to look up the setter used to restore the property. So if the property is named expanded then the library will expect a setter method named setExpanded.

      It should be noted that production mode persistent properties that are not persisted across reloads will use synthetic keys as an optimization strategy.

      Returns:
      the name used to persist the property.
      Default:
      "<default>"
    • store

      @Nonnull String store
      The key identifying the store where the observable data is stored. The name of the store must comply with the requirements for a java identifier.
      Returns:
      the key identifying the store where the observable data is stored.
      Default:
      "<default>"
    • setterName

      @Nonnull String setterName
      Return the name of the setter. If unspecified the tool assumes that the setter method is named according to javabeans setter based on the derived name() of the property. So if the property is named expanded then the library will derive a setter method named setExpanded.
      Returns:
      the name of the setter used to update value when restoring from a persisted store.
      Default:
      "<default>"