Package com.google.gerrit.server.config
Class ProjectConfigEntry
- java.lang.Object
-
- com.google.gerrit.server.config.ProjectConfigEntry
-
public class ProjectConfigEntry extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ProjectConfigEntry.UpdateChecker
-
Constructor Summary
Constructors Constructor Description ProjectConfigEntry(String displayName, boolean defaultValue)
ProjectConfigEntry(String displayName, boolean defaultValue, String description)
ProjectConfigEntry(String displayName, int defaultValue)
ProjectConfigEntry(String displayName, int defaultValue, boolean inheritable)
ProjectConfigEntry(String displayName, int defaultValue, boolean inheritable, String description)
ProjectConfigEntry(String displayName, long defaultValue)
ProjectConfigEntry(String displayName, long defaultValue, boolean inheritable)
ProjectConfigEntry(String displayName, long defaultValue, boolean inheritable, String description)
ProjectConfigEntry(String displayName, String defaultValue)
ProjectConfigEntry(String displayName, String defaultValue, boolean inheritable)
ProjectConfigEntry(String displayName, String defaultValue, boolean inheritable, String description)
ProjectConfigEntry(String displayName, String defaultValue, ProjectConfigEntryType type, List<String> permittedValues, boolean inheritable, String description)
ProjectConfigEntry(String displayName, String defaultValue, List<String> permittedValues)
ProjectConfigEntry(String displayName, String defaultValue, List<String> permittedValues, boolean inheritable)
ProjectConfigEntry(String displayName, String defaultValue, List<String> permittedValues, boolean inheritable, String description)
ProjectConfigEntry(String displayName, T defaultValue, Class<T> permittedValues)
ProjectConfigEntry(String displayName, T defaultValue, Class<T> permittedValues, boolean inheritable)
ProjectConfigEntry(String displayName, T defaultValue, Class<T> permittedValues, boolean inheritable, String description)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getDefaultValue()
String
getDescription()
String
getDisplayName()
List<String>
getPermittedValues()
ProjectConfigEntryType
getType()
String
getWarning(ProjectState project)
Returns any warning associated with the projectboolean
isEditable(ProjectState project)
Returns whether the project is editableboolean
isInheritable()
String
onRead(ProjectState project, String value)
Called after reading the project config value.List<String>
onRead(ProjectState project, List<String> values)
Called after reading the project config value of type ARRAY.void
onUpdate(Project.NameKey project, Boolean oldValue, Boolean newValue)
Called after a project config is updated.void
onUpdate(Project.NameKey project, Integer oldValue, Integer newValue)
Called after a project config is updated.void
onUpdate(Project.NameKey project, Long oldValue, Long newValue)
Called after a project config is updated.void
onUpdate(Project.NameKey project, String oldValue, String newValue)
Called after a project config is updated.ConfigValue
preUpdate(ConfigValue configValue)
Called before the project config is updated.
-
-
-
Constructor Detail
-
ProjectConfigEntry
public ProjectConfigEntry(String displayName, String defaultValue, boolean inheritable)
-
ProjectConfigEntry
public ProjectConfigEntry(String displayName, String defaultValue, boolean inheritable, String description)
-
ProjectConfigEntry
public ProjectConfigEntry(String displayName, int defaultValue)
-
ProjectConfigEntry
public ProjectConfigEntry(String displayName, int defaultValue, boolean inheritable)
-
ProjectConfigEntry
public ProjectConfigEntry(String displayName, int defaultValue, boolean inheritable, String description)
-
ProjectConfigEntry
public ProjectConfigEntry(String displayName, long defaultValue)
-
ProjectConfigEntry
public ProjectConfigEntry(String displayName, long defaultValue, boolean inheritable)
-
ProjectConfigEntry
public ProjectConfigEntry(String displayName, long defaultValue, boolean inheritable, String description)
-
ProjectConfigEntry
public ProjectConfigEntry(String displayName, boolean defaultValue)
-
ProjectConfigEntry
public ProjectConfigEntry(String displayName, boolean defaultValue, String description)
-
ProjectConfigEntry
public ProjectConfigEntry(String displayName, String defaultValue, List<String> permittedValues)
-
ProjectConfigEntry
public ProjectConfigEntry(String displayName, String defaultValue, List<String> permittedValues, boolean inheritable)
-
ProjectConfigEntry
public ProjectConfigEntry(String displayName, String defaultValue, List<String> permittedValues, boolean inheritable, String description)
-
ProjectConfigEntry
public ProjectConfigEntry(String displayName, T defaultValue, Class<T> permittedValues)
-
ProjectConfigEntry
public ProjectConfigEntry(String displayName, T defaultValue, Class<T> permittedValues, boolean inheritable)
-
ProjectConfigEntry
public ProjectConfigEntry(String displayName, T defaultValue, Class<T> permittedValues, boolean inheritable, String description)
-
-
Method Detail
-
getDisplayName
public String getDisplayName()
-
getDescription
public String getDescription()
-
isInheritable
public boolean isInheritable()
-
getDefaultValue
public String getDefaultValue()
-
getType
public ProjectConfigEntryType getType()
-
isEditable
public boolean isEditable(ProjectState project)
Returns whether the project is editable- Parameters:
project
- project state.
-
getWarning
public String getWarning(ProjectState project)
Returns any warning associated with the project- Parameters:
project
- project state.
-
preUpdate
public ConfigValue preUpdate(ConfigValue configValue)
Called before the project config is updated. To modify the value before the project config is updated, override this method and return the modified value. Default implementation returns the same value.- Parameters:
configValue
- the original configValue that was entered.- Returns:
- the modified configValue.
-
onRead
public String onRead(ProjectState project, String value)
Called after reading the project config value. To modify the value before returning it to the client, override this method and return the modified value. Default implementation returns the same value.- Parameters:
project
- the project.value
- the actual value of the config entry (computed out of the configured value, the inherited value and the default value).- Returns:
- the modified value.
-
onRead
public List<String> onRead(ProjectState project, List<String> values)
Called after reading the project config value of type ARRAY. To modify the values before returning it to the client, override this method and return the modified values. Default implementation returns the same values.- Parameters:
project
- the project.values
- the actual values of the config entry (computed out of the configured value, the inherited value and the default value).- Returns:
- the modified values.
-
onUpdate
public void onUpdate(Project.NameKey project, String oldValue, String newValue)
Called after a project config is updated.- Parameters:
project
- project name.oldValue
- old entry value.newValue
- new entry value.
-
onUpdate
public void onUpdate(Project.NameKey project, Boolean oldValue, Boolean newValue)
Called after a project config is updated.- Parameters:
project
- project name.oldValue
- old entry value.newValue
- new entry value.
-
onUpdate
public void onUpdate(Project.NameKey project, Integer oldValue, Integer newValue)
Called after a project config is updated.- Parameters:
project
- project name.oldValue
- old entry value.newValue
- new entry value.
-
onUpdate
public void onUpdate(Project.NameKey project, Long oldValue, Long newValue)
Called after a project config is updated.- Parameters:
project
- project name.oldValue
- old entry value.newValue
- new entry value.
-
-