Class CachedPreferences

java.lang.Object
com.google.gerrit.server.config.CachedPreferences

public abstract class CachedPreferences extends Object
Container class for preferences serialized as Git-style config files. Keeps the values as Cache.CachedPreferencesProtos as they are immutable and thread-safe.

The config string wrapped by this class might represent different structures. See Cache.CachedPreferencesProto for more details.

  • Field Details

  • Constructor Details

    • CachedPreferences

      public CachedPreferences()
  • Method Details

    • config

      protected abstract com.google.gerrit.server.cache.proto.Cache.CachedPreferencesProto config()
    • nonEmptyConfig

      public Optional<com.google.gerrit.server.cache.proto.Cache.CachedPreferencesProto> nonEmptyConfig()
    • fromUserPreferencesProto

      public static CachedPreferences fromUserPreferencesProto(com.google.gerrit.proto.Entities.UserPreferences proto)
      Returns a cache-able representation of the preferences proto.
    • fromLegacyConfig

      public static CachedPreferences fromLegacyConfig(org.eclipse.jgit.lib.Config cfg)
      Returns a cache-able representation of the git config.
    • fromCachedPreferencesProto

      public static CachedPreferences fromCachedPreferencesProto(com.google.gerrit.server.cache.proto.Cache.CachedPreferencesProto proto)
      Returns a cache-able representation of the preferences proto.
    • general

      public static GeneralPreferencesInfo general(Optional<CachedPreferences> defaultPreferences, CachedPreferences userPreferences)
    • diff

      public static DiffPreferencesInfo diff(Optional<CachedPreferences> defaultPreferences, CachedPreferences userPreferences)
    • edit

      public static EditPreferencesInfo edit(Optional<CachedPreferences> defaultPreferences, CachedPreferences userPreferences)
    • asConfig

      public org.eclipse.jgit.lib.Config asConfig()
    • asUserPreferencesProto

      public com.google.gerrit.proto.Entities.UserPreferences asUserPreferencesProto()