Class UserExperimentalFlag<T>

  • All Implemented Interfaces:
    Direct Known Subclasses:

    public abstract class UserExperimentalFlag<T>
    extends Object
    implements ExtensionPoint
    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.
    • Constructor Detail

      • UserExperimentalFlag

        protected UserExperimentalFlag​(@NonNull
                                       String flagKey)
    • Method Detail

      • getDefaultValue

        public abstract T getDefaultValue()
      • serializeValue

        public abstract Object serializeValue​(T rawValue)
        Convert the usable value into a serializable form that can be stored in the user property. If no changes are necessary, simply returning the rawValue is fine.
      • deserializeValue

        protected abstract T deserializeValue​(Object serializedValue)
        Convert the serialized value into the usable instance. If the instance is invalid (like after migration), returning null will force to return the getDefaultValue()
      • getDisplayName

        public abstract String getDisplayName()
        The name that will be used in the configuration page for that flag It must be user readable
      • getShortDescription

        public abstract String 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

        public String getFlagKey()
        The ID used by the machine to link the flag with its value within the user properties
      • getFlagValue

        public T getFlagValue()
      • getFlagValue

        public T getFlagValue​(User user)
      • getFlagDescriptionPage

        public String getFlagDescriptionPage()
      • getFlagConfigPage

        public String getFlagConfigPage()
      • getFlagValueForCurrentUser

        public static <T> T getFlagValueForCurrentUser​(String flagClassCanonicalName)
        From the flag class, return the value of the flag for the current user If the returned value is null, it means that either the class was not found or the current user is anonymous