Class BaseStringPersistenceProvider

java.lang.Object
gg.xp.xivsupport.persistence.BaseStringPersistenceProvider
All Implemented Interfaces:
PersistenceProvider
Direct Known Subclasses:
InMemoryMapPersistenceProvider, PropertiesFilePersistenceProvider, SimplifiedPropertiesFilePersistenceProvider

public abstract class BaseStringPersistenceProvider extends Object implements PersistenceProvider
  • Constructor Details

    • BaseStringPersistenceProvider

      public BaseStringPersistenceProvider()
  • Method Details

    • save

      public void save(@NotNull @NotNull String key, @NotNull @NotNull Object value)
      Specified by:
      save in interface PersistenceProvider
    • get

      public <X> X get(@NotNull @NotNull String key, @NotNull @NotNull Class<X> type, @Nullable X dflt)
      Specified by:
      get in interface PersistenceProvider
    • get

      public <X> X get(@NotNull @NotNull String key, @NotNull @NotNull com.fasterxml.jackson.core.type.TypeReference<X> type, @Nullable X dflt)
      Specified by:
      get in interface PersistenceProvider
    • getRaw

      @Nullable public @Nullable String getRaw(@NotNull @NotNull String key)
    • saveRaw

      public void saveRaw(String key, String value)
    • clearAll

      public void clearAll()
      Specified by:
      clearAll in interface PersistenceProvider
    • delete

      public void delete(@NotNull @NotNull String key)
      Specified by:
      delete in interface PersistenceProvider
    • rewriteKey

      protected String rewriteKey(String originalKey)
      Since not every format may be able to handle every cdKey correctly, provide an optional way to massage the cdKey into a better format (e.g. stripping special characters)
      Parameters:
      originalKey - Original cdKey
      Returns:
      Massaged cdKey
    • setValue

      protected abstract void setValue(@NotNull @NotNull String key, @Nullable @Nullable String value)
    • deleteValue

      protected abstract void deleteValue(@NotNull @NotNull String key)
    • getValue

      @Nullable protected abstract @Nullable String getValue(@NotNull @NotNull String key)
    • clearAllValues

      protected abstract void clearAllValues()