Class ConfigurationSetting

    • Method Detail

      • defaultValue

        public java.lang.Object defaultValue()
        The default value for the setting
        Returns:
        default value or null if the setting has no default value
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • canOverride

        public boolean canOverride()
        Indicates if this setting can be overridden through SchemaOverride.
        Returns:
        true if this setting can be overridden at runtime.
      • isGlobal

        public boolean isGlobal()
        Indicates if this is a global level setting
        Returns:
        true if this setting can only be configured for the entire application, false otherwise
      • isSecure

        public boolean isSecure()
        Indicates if this setting contains sensitive data that must be kept secure
        Returns:
        true if this setting contains sensitive data
      • status

        public ConfigurationStatus status()
        The status of the configuration property
        Returns:
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • type

        public java.lang.Class<?> type()
        The type of the setting
        Returns:
        The type of the setting
      • isConfigurationType

        public static boolean isConfigurationType​(java.lang.Class<?> type)
        Indicates if the specific type is a supported ConfigurationSetting type
        Parameters:
        type - The type to check
        Returns:
        true if the type is supported, false otherwise
      • setting

        public static ConfigurationSetting setting​(boolean defaultValue)
        Define a Boolean setting
        Parameters:
        defaultValue - The default value. For consistency the default value should always be false
        Returns:
        ConfigurationSetting instance
      • setting

        public static ConfigurationSetting setting​(boolean defaultValue,
                                                   Translatable description)
        Define a Boolean setting
        Parameters:
        defaultValue - The default value. For consistency the default value should always be false
        description - Describe the purpose of the setting
        Returns:
        ConfigurationSetting instance
      • setting

        public static <T extends java.lang.Enum<T>> ConfigurationSetting setting​(java.lang.Class<T> type,
                                                                                 T defaultValue)
        Define an Enum setting
        Type Parameters:
        T - An Enum sub-type
        Parameters:
        type - The type of the Enum subclass
        defaultValue - The default value.
        Returns:
        ConfigurationSetting instance
      • setting

        public static <T extends java.lang.Enum<T>> ConfigurationSetting setting​(java.lang.Class<T> type,
                                                                                 T defaultValue,
                                                                                 Translatable description)
        Define an Enum setting
        Type Parameters:
        T - An Enum sub-type
        Parameters:
        type - The type of the Enum subclass
        defaultValue - The default value.
        description - Describe the purpose of the setting
        Returns:
        ConfigurationSetting instance
      • setting

        public static ConfigurationSetting setting​(int defaultValue,
                                                   Translatable description)
        Define an Integer property
        Parameters:
        defaultValue - The default value.
        description - Describe the purpose of the setting
        Returns:
        ConfigurationSetting instance
      • setting

        public static ConfigurationSetting setting​(long defaultValue,
                                                   Translatable description)
        Define a Long setting
        Parameters:
        defaultValue - The default value.
        description - Describe the purpose of the setting
        Returns:
        ConfigurationSetting instance
      • setting

        public static ConfigurationSetting setting​(java.lang.String defaultValue,
                                                   Translatable description)
        Define a String property
        Parameters:
        defaultValue - The default value.
        description - Describe the purpose of the setting
        Returns:
        ConfigurationSetting instance
      • settings

        public static java.util.Map<java.lang.String,​ConfigurationSetting> settings​(java.lang.Class<?> type)
        Enumerates the settings defined by the specified type. Note this method involves reflection and is expensive and should only be called rarely, preferably in a static initializer
        Parameters:
        type - The type to enumerate the settings for
        Returns:
        Map of setting name to ConfigurationSetting mappings