public class SettingsKey extends Object
ProjectSettingsRestriction for the settings of a given feature.
A SettingsKey provides a unique identifier for an individual feature using a
ProjectSettingsRestriction. Each SettingsKey is composed of a getNamespace()
which represents plugin provider, and a getFeatureKey() which represents the feature being restricted.
A settings key can also have an optional getComponentKey(), which represents an individual component of a
feature that can restricted.
Note that it is possible for consumers to provide settings keys that have the same feature key and namespace, but with both null and non-null component keys. This is a permitted operation, but we provide no particular handling for it, and the meaning of these restrictions is left to the consumer to determine.
The getFeatureKey(), getNamespace() and getComponentKey() are all defined by the feature
provider, though in general each provider should use the same namespace for all features they offer restrictions for,
a unique feature key for every feature and use component keys only when each component of a feature should share the
same post processor.
ProjectSettingsRestriction| Modifier and Type | Class and Description |
|---|---|
static class |
SettingsKey.Builder |
| Modifier and Type | Field and Description |
|---|---|
static int |
MAX_COMPONENT_KEY_LENGTH |
static int |
MAX_FEATURE_KEY_LENGTH |
static int |
MAX_NAMESPACE_LENGTH |
static int |
MIN_COMPONENT_KEY_LENGTH |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o) |
Optional<String> |
getComponentKey()
The component key part of the settings key.
|
String |
getFeatureKey()
The feature key part of the settings key.
|
String |
getNamespace()
The namespace part of the settings key.
|
int |
hashCode() |
String |
toString() |
public static final int MIN_COMPONENT_KEY_LENGTH
public static final int MAX_FEATURE_KEY_LENGTH
public static final int MAX_NAMESPACE_LENGTH
public static final int MAX_COMPONENT_KEY_LENGTH
@Nonnull public Optional<String> getComponentKey()
The component key should be used when multiple components of a single feature can individually be restricted or unrestricted. Settings that have the same namespace and feature key but differing component keys will share the same post-processing.
The component key must be between MIN_COMPONENT_KEY_LENGTH and MAX_COMPONENT_KEY_LENGTH
characters in length.
getFeatureKey()@Nonnull public String getFeatureKey()
The feature key can not be blank or longer than MAX_FEATURE_KEY_LENGTH characters.
getNamespace()@Nonnull public String getNamespace()
The namespace can not be blank or longer than MAX_NAMESPACE_LENGTH characters. Plugin developers are
recommended to use a namespace tied to the plugin. A good example would be using reverse domain names used by
java packages.
Copyright © 2023 Atlassian. All rights reserved.