Package jenkins.model.experimentalflags
Class UserExperimentalFlag<T>
java.lang.Object
jenkins.model.experimentalflags.UserExperimentalFlag<T>
- All Implemented Interfaces:
ExtensionPoint
- Direct Known Subclasses:
BooleanUserExperimentalFlag
User specific experimental flag to enable or disable specific behavior.
As it's user specific, usually this kind of feature flag is only used for UI.
- Since:
- 2.395
-
Nested Class Summary
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic ExtensionList<UserExperimentalFlag>
all()
protected abstract T
deserializeValue
(Object serializedValue) Convert the serialized value into the usable instance.abstract T
abstract String
The name that will be used in the configuration page for that flag It must be user readableThe ID used by the machine to link the flag with its value within the user propertiesgetFlagValue
(User user) static <T> T
getFlagValueForCurrentUser
(String flagClassCanonicalName) From the flag class, return the value of the flag for the current user If the returned value isnull
, it means that either the class was not found or the current user is anonymousabstract String
Describe what the flag is changing depending on its value.abstract Object
serializeValue
(T rawValue) Convert the usable value into a serializable form that can be stored in the user property.
-
Constructor Details
-
UserExperimentalFlag
-
-
Method Details
-
getDefaultValue
-
serializeValue
Convert the usable value into a serializable form that can be stored in the user property. If no changes are necessary, simply returning therawValue
is fine. -
deserializeValue
Convert the serialized value into the usable instance. If the instance is invalid (like after migration), returningnull
will force to return thegetDefaultValue()
-
getDisplayName
The name that will be used in the configuration page for that flag It must be user readable -
getShortDescription
Describe what the flag is changing depending on its value. This method is called in description.jelly, which could be overloaded by children. It could return HTML content. -
getFlagKey
The ID used by the machine to link the flag with its value within the user properties -
getFlagValue
-
getFlagValue
-
getFlagDescriptionPage
-
getFlagConfigPage
-
all
-
getFlagValueForCurrentUser
From the flag class, return the value of the flag for the current user If the returned value isnull
, it means that either the class was not found or the current user is anonymous
-