Package com.google.gerrit.server.config
Class CachedPreferences
java.lang.Object
com.google.gerrit.server.config.CachedPreferences
Container class for preferences serialized as Git-style config files. Keeps the values as
Cache.CachedPreferencesProto
s 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 Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.eclipse.jgit.lib.Config
asConfig()
com.google.gerrit.proto.Entities.UserPreferences
protected abstract com.google.gerrit.server.cache.proto.Cache.CachedPreferencesProto
config()
static DiffPreferencesInfo
diff
(Optional<CachedPreferences> defaultPreferences, CachedPreferences userPreferences) static EditPreferencesInfo
edit
(Optional<CachedPreferences> defaultPreferences, CachedPreferences userPreferences) static CachedPreferences
fromCachedPreferencesProto
(com.google.gerrit.server.cache.proto.Cache.CachedPreferencesProto proto) Returns a cache-able representation of the preferences proto.static CachedPreferences
fromLegacyConfig
(org.eclipse.jgit.lib.Config cfg) Returns a cache-able representation of the git config.static CachedPreferences
fromUserPreferencesProto
(com.google.gerrit.proto.Entities.UserPreferences proto) Returns a cache-able representation of the preferences proto.static GeneralPreferencesInfo
general
(Optional<CachedPreferences> defaultPreferences, CachedPreferences userPreferences) Optional<com.google.gerrit.server.cache.proto.Cache.CachedPreferencesProto>
-
Field Details
-
EMPTY
-
-
Constructor Details
-
CachedPreferences
public CachedPreferences()
-
-
Method Details
-
config
protected abstract com.google.gerrit.server.cache.proto.Cache.CachedPreferencesProto config() -
nonEmptyConfig
-
fromUserPreferencesProto
public static CachedPreferences fromUserPreferencesProto(com.google.gerrit.proto.Entities.UserPreferences proto) Returns a cache-able representation of the preferences proto. -
fromLegacyConfig
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()
-