Class ProjectConfigEntry


  • public class ProjectConfigEntry
    extends Object
    • Constructor Detail

      • ProjectConfigEntry

        public ProjectConfigEntry​(String displayName,
                                  String defaultValue)
      • 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()
      • getPermittedValues

        public List<String> getPermittedValues()
      • 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.