001package arez.persist;
002
003import arez.persist.runtime.ArezPersist;
004import arez.persist.runtime.browser.ArezPersistBrowserUtil;
005import javax.annotation.Nonnull;
006
007/**
008 * A class containing constants for persistence stores supplied by the library.
009 * Other persistence stores are possible but must be explicitly registered by the
010 * developer.
011 */
012public final class StoreTypes
013{
014  /**
015   * The property is persisted in memory and will be lost when the application is reloaded.
016   * This persist strategy is only available when {@link ArezPersist#isApplicationStoreEnabled()}
017   * returns {@code true}.
018   */
019  @Nonnull
020  public static final String APPLICATION = "app";
021  /**
022   * The property is persisted across the session. i.e. The value of the property will be
023   * persisted across reloads within the same tab. This persist strategy is only available
024   * when {@link ArezPersistBrowserUtil#registerSessionStore(String)} has been invoked.
025   */
026  @Nonnull
027  public static final String SESSION = "session";
028  /**
029   * The property is persisted when using the same browser. i.e. The value of the property will be
030   * persisted across reloads within the same browser. If multiple browsers are open and concurrently
031   * persisting storage then they may overwrite each other and the last value persisted "wins".
032   * This persist strategy is only available when {@link ArezPersistBrowserUtil#registerLocalStore(String)}
033   * has been invoked.
034   */
035  @Nonnull
036  public static final String LOCAL = "local";
037
038  private StoreTypes()
039  {
040  }
041}