Package arez.persist

Annotation Interface PersistType


@Documented @Target(TYPE) public @interface PersistType
Annotation applied to arez components that triggers the generation of persistence code.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    The key identifying the default store where the observable data is stored.
    Return the name used to persist the type.
    boolean
    Setting controlling whether the sidecar attempts to force a persist of state when the sidecar is disposed.
  • Element Details

    • name

      @Nonnull String name
      Return the name used to persist the type. If not specified, then the simple name of the class will be used. The name must comply with the requirements for a java identifier.

      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>"
    • defaultStore

      The key identifying the default store where the observable data is stored. Individual properties annotated with the Persist annotation can still override the store used. The name of the defaultStore must comply with the requirements for a java identifier.
      Returns:
      the key identifying the default store where the observable data is stored.
      Default:
      "app"
    • persistOnDispose

      Setting controlling whether the sidecar attempts to force a persist of state when the sidecar is disposed. This is usually performed as part of the normal arez reaction cycle but can be skipped unless the sidecar is explicitly disposed within another arez transaction while a change has been made to persistent properties that have yet to be committed to the storage service. This is not normally a problem so it is disabled by default to reduce generated code size.
      Returns:
      true to force a persist when the sidecar is disposed, false otherwise.
      Default:
      false