oracle.dbtools.plugin.api.conf

## Class ConfigurationSetting

- java.lang.Object
- - oracle.dbtools.plugin.api.conf.ConfigurationSetting

-     public final class ConfigurationSetting
      extends Object

  Declares a `ConfigurationSetting`, specifying it's type, and default value.
  Author:
    cdivilly
  See Also:
    `oracle.dbtools.plugin.api.conf` package description

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `ConfigurationSetting.Builder` Builds `ConfigurationSetting` instances
    `static interface` | `ConfigurationSetting.Description` Deprecated. since 20.3.0. Use Builder#

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Object` | `defaultValue()` The default value for the setting
    `Translatable` | `description()`
    `boolean` | `equals(Object obj)`
    `int` | `hashCode()`
    `static boolean` | `isConfigurationType(Class<?> type)` Indicates if the specific type is a supported `ConfigurationSetting` type
    `boolean` | `isGlobal()` Indicates if this is a global level setting
    `boolean` | `isSecure()` Indicates if this setting contains sensitive data that must be kept secure
    `ConfigurationSetting.Builder` | `modify()` Produce a new `ConfigurationSetting.Builder` instance initialized with the state of this `ConfigurationSetting`
    `static ConfigurationSetting.Builder` | `setting()` Create a `ConfigurationSetting.Builder` instance
    `static ConfigurationSetting` | `setting(boolean defaultValue)` Define a `Boolean` setting
    `static ConfigurationSetting` | `setting(boolean defaultValue, Translatable description)` Define a `Boolean` setting
    `static <T extends Enum<T>> ConfigurationSetting` | `setting(Class<T> type, T defaultValue)` Define an `Enum` setting
    `static <T extends Enum<T>> ConfigurationSetting` | `setting(Class<T> type, T defaultValue, Translatable description)` Define an `Enum` setting
    `static ConfigurationSetting` | `setting(int defaultValue)` Define an `Integer` property
    `static ConfigurationSetting` | `setting(int defaultValue, Translatable description)` Define an `Integer` property
    `static ConfigurationSetting` | `setting(long defaultValue)` Define a `Long` setting
    `static ConfigurationSetting` | `setting(long defaultValue, Translatable description)` Define a `Long` setting
    `static ConfigurationSetting` | `setting(String defaultValue)` Define a `String` property
    `static ConfigurationSetting` | `setting(String defaultValue, Translatable description)` Define a `String` property
    `static ConfigurationSetting` | `setting(TimeDuration defaultValue)` Define a `TimeDuration` property
    `static ConfigurationSetting` | `setting(TimeDuration defaultValue, Translatable description)` Define a `TimeDuration` property
    `static Map<String,ConfigurationSetting>` | `settings(Class<?> type)` Enumerates the settings defined by the specified type.
    `String` | `toString()`
    `Class<?>` | `type()` The type of the setting

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Method Detail

    - #### defaultValue

          public Object defaultValue()

      The default value for the setting
      Returns:
        default value or `null` if the setting has no default value

    - #### description

          public Translatable description()

    - #### equals

          public boolean equals(Object obj)

      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### 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

    - #### modify

          public ConfigurationSetting.Builder modify()

      Produce a new `ConfigurationSetting.Builder` instance initialized with the state of this `ConfigurationSetting`
      Returns:
        `ConfigurationSetting.Builder` instance

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### type

          public Class<?> type()

      The type of the setting
      Returns:
        The type of the setting

    - #### isConfigurationType

          public static boolean isConfigurationType(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.Builder setting()

      Create a `ConfigurationSetting.Builder` instance
      Returns:
        `ConfigurationSetting.Builder` instance

    - #### 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 Enum<T>> ConfigurationSetting setting(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 Enum<T>> ConfigurationSetting setting(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)

      Define an `Integer` property
      Parameters:
        `defaultValue` - The default value.
      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)

      Define a `Long` setting
      Parameters:
        `defaultValue` - The default value.
      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(String defaultValue)

      Define a `String` property
      Parameters:
        `defaultValue` - The default value.
      Returns:
        `ConfigurationSetting` instance

    - #### setting

          public static ConfigurationSetting setting(String defaultValue,
                                                     Translatable description)

      Define a `String` property
      Parameters:
        `defaultValue` - The default value.
        `description` - Describe the purpose of the setting
      Returns:
        `ConfigurationSetting` instance

    - #### setting

          public static ConfigurationSetting setting(TimeDuration defaultValue)

      Define a `TimeDuration` property
      Parameters:
        `defaultValue` - The default value
      Returns:
        `ConfigurationSetting` instance

    - #### setting

          public static ConfigurationSetting setting(TimeDuration defaultValue,
                                                     Translatable description)

      Define a `TimeDuration` property
      Parameters:
        `defaultValue` - The default value
        `description` - Describe the purpose of the setting
      Returns:
        `ConfigurationSetting` instance

    - #### settings

          public static Map<String,ConfigurationSetting> settings(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

Copyright © 2010, 2022, Oracle and/or its affiliates.