Package org.sonar.api.config
Class PropertyDefinition.Builder
- java.lang.Object
-
- org.sonar.api.config.PropertyDefinition.Builder
-
- Enclosing class:
- PropertyDefinition
public static class PropertyDefinition.Builder extends java.lang.Object
-
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description PropertyDefinition
build()
PropertyDefinition.Builder
category(java.lang.String category)
PropertyDefinition.Builder
defaultValue(java.lang.String defaultValue)
PropertyDefinition.Builder
deprecatedKey(java.lang.String deprecatedKey)
PropertyDefinition.Builder
description(java.lang.String description)
PropertyDefinition.Builder
fields(java.util.List<PropertyFieldDefinition> fields)
PropertyDefinition.Builder
fields(PropertyFieldDefinition first, PropertyFieldDefinition... rest)
PropertyDefinition.Builder
hidden()
Flag the property as hidden.PropertyDefinition.Builder
index(int index)
Set the order index in Settings pages.PropertyDefinition.Builder
multiValues(boolean multiValues)
PropertyDefinition.Builder
name(java.lang.String name)
PropertyDefinition.Builder
onConfigScopes(java.util.Collection<PropertyDefinition.ConfigScope> configScopes)
The property will be available in the General Settings AND in the given scopes.PropertyDefinition.Builder
onConfigScopes(PropertyDefinition.ConfigScope first, PropertyDefinition.ConfigScope... rest)
The property will be available in the General Settings AND in the given scopes.PropertyDefinition.Builder
onlyOnConfigScopes(java.util.Collection<PropertyDefinition.ConfigScope> configScopes)
The property will be configurable in the given scopes, but NOT in General Settings.PropertyDefinition.Builder
onlyOnConfigScopes(PropertyDefinition.ConfigScope first, PropertyDefinition.ConfigScope... rest)
The property will be configurable in the given scopes, but NOT in General Settings.PropertyDefinition.Builder
onlyOnQualifiers(java.lang.String first, java.lang.String... rest)
Deprecated, for removal: This API element is subject to removal in a future version.since 10.13.PropertyDefinition.Builder
onlyOnQualifiers(java.util.List<java.lang.String> qualifiers)
Deprecated, for removal: This API element is subject to removal in a future version.since 10.13.PropertyDefinition.Builder
onQualifiers(java.lang.String first, java.lang.String... rest)
Deprecated, for removal: This API element is subject to removal in a future version.since 10.13.PropertyDefinition.Builder
onQualifiers(java.util.List<java.lang.String> qualifiers)
Deprecated, for removal: This API element is subject to removal in a future version.since 10.13.PropertyDefinition.Builder
options(java.lang.String first, java.lang.String... rest)
PropertyDefinition.Builder
options(java.util.List<java.lang.String> options)
PropertyDefinition.Builder
subCategory(java.lang.String subCategory)
PropertyDefinition.Builder
type(PropertyType type)
-
-
-
Method Detail
-
description
public PropertyDefinition.Builder description(java.lang.String description)
-
name
public PropertyDefinition.Builder name(java.lang.String name)
- See Also:
PropertyDefinition.name()
-
defaultValue
public PropertyDefinition.Builder defaultValue(java.lang.String defaultValue)
- See Also:
PropertyDefinition.defaultValue()
-
category
public PropertyDefinition.Builder category(java.lang.String category)
- See Also:
PropertyDefinition.category()
-
subCategory
public PropertyDefinition.Builder subCategory(java.lang.String subCategory)
- See Also:
PropertyDefinition.subCategory()
-
onConfigScopes
public PropertyDefinition.Builder onConfigScopes(PropertyDefinition.ConfigScope first, PropertyDefinition.ConfigScope... rest)
The property will be available in the General Settings AND in the given scopes.
For example @{code onConfigScopes(ConfigScope.PROJECT)} allows to configure the property in the General Settings and in the Project Settings.
See supported constant values inPropertyDefinition.ConfigScope
. By default, a property is available only in the General Settings.- Throws:
java.lang.IllegalArgumentException
- only qualifiersPropertyDefinition.ConfigScope.PROJECT
,PropertyDefinition.ConfigScope.APP
,PropertyDefinition.ConfigScope.VIEW
andPropertyDefinition.ConfigScope.SUB_VIEW
are allowed.- Since:
- 10.13
-
onQualifiers
@Deprecated(since="10.13", forRemoval=true) public PropertyDefinition.Builder onQualifiers(java.lang.String first, java.lang.String... rest)
Deprecated, for removal: This API element is subject to removal in a future version.since 10.13. UseonConfigScopes(ConfigScope, ConfigScope...)
instead.
-
onConfigScopes
public PropertyDefinition.Builder onConfigScopes(java.util.Collection<PropertyDefinition.ConfigScope> configScopes)
The property will be available in the General Settings AND in the given scopes.
For example @{code onConfigScopes(Arrays.asList(ConfigScope.PROJECT))} allows to configure the property in the General Settings and in the Project Settings.
See supported constant values inPropertyDefinition.ConfigScope
. By default, a property is available only in the General Settings.- Throws:
java.lang.IllegalArgumentException
- only qualifiersPropertyDefinition.ConfigScope.PROJECT
,PropertyDefinition.ConfigScope.APP
,PropertyDefinition.ConfigScope.VIEW
andPropertyDefinition.ConfigScope.SUB_VIEW
are allowed.- Since:
- 10.13
-
onQualifiers
@Deprecated(since="10.13", forRemoval=true) public PropertyDefinition.Builder onQualifiers(java.util.List<java.lang.String> qualifiers)
Deprecated, for removal: This API element is subject to removal in a future version.since 10.13. UseonConfigScopes(Collection)
instead.
-
onlyOnConfigScopes
public PropertyDefinition.Builder onlyOnConfigScopes(PropertyDefinition.ConfigScope first, PropertyDefinition.ConfigScope... rest)
The property will be configurable in the given scopes, but NOT in General Settings.
For example @{code onlyOnConfigScopes(ConfigScope.PROJECT)} allows to configure the property in Project Settings only.
See supported constant values inPropertyDefinition.ConfigScope
. By default, a property is available only in the General Settings.- Throws:
java.lang.IllegalArgumentException
- only qualifiersPropertyDefinition.ConfigScope.PROJECT
,PropertyDefinition.ConfigScope.APP
,PropertyDefinition.ConfigScope.VIEW
andPropertyDefinition.ConfigScope.SUB_VIEW
are allowed.- Since:
- 10.13
-
onlyOnQualifiers
@Deprecated(since="10.13", forRemoval=true) public PropertyDefinition.Builder onlyOnQualifiers(java.lang.String first, java.lang.String... rest)
Deprecated, for removal: This API element is subject to removal in a future version.since 10.13. UseonlyOnConfigScopes(ConfigScope, ConfigScope...)
instead.
-
onlyOnConfigScopes
public PropertyDefinition.Builder onlyOnConfigScopes(java.util.Collection<PropertyDefinition.ConfigScope> configScopes)
The property will be configurable in the given scopes, but NOT in General Settings.
For example @{code onlyOnConfigScopes(Arrays.asList(ConfigScope.PROJECT))} allows to configure the property in Project Settings only.
See supported constant values inPropertyDefinition.ConfigScope
. By default, a property is available only in the General Settings.
-
onlyOnQualifiers
@Deprecated(since="10.13", forRemoval=true) public PropertyDefinition.Builder onlyOnQualifiers(java.util.List<java.lang.String> qualifiers)
Deprecated, for removal: This API element is subject to removal in a future version.since 10.13. UseonlyOnConfigScopes(Collection)
instead.
-
type
public PropertyDefinition.Builder type(PropertyType type)
- See Also:
PropertyDefinition.type()
-
options
public PropertyDefinition.Builder options(java.lang.String first, java.lang.String... rest)
-
options
public PropertyDefinition.Builder options(java.util.List<java.lang.String> options)
-
multiValues
public PropertyDefinition.Builder multiValues(boolean multiValues)
-
fields
public PropertyDefinition.Builder fields(PropertyFieldDefinition first, PropertyFieldDefinition... rest)
-
fields
public PropertyDefinition.Builder fields(java.util.List<PropertyFieldDefinition> fields)
-
deprecatedKey
public PropertyDefinition.Builder deprecatedKey(java.lang.String deprecatedKey)
-
hidden
public PropertyDefinition.Builder hidden()
Flag the property as hidden. Hidden properties are not displayed in Settings pages but allow plugins to benefit from type and default values when callingConfiguration
.
-
index
public PropertyDefinition.Builder index(int index)
Set the order index in Settings pages. A property with a lower index is displayed before properties with higher index.
-
build
public PropertyDefinition build()
-
-