Class ExperimentRegistry
java.lang.Object
org.skriptlang.skript.lang.experiment.ExperimentRegistry
- All Implemented Interfaces:
Experimented
A manager for registering (and identifying) experimental feature flags.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@NotNull ExperimentFinds an experiment matching this name.booleanhasExperiment(String featureName) booleanhasExperiment(Experiment experiment) booleanWhether a script is using an experiment.booleanisUsing(Script script, Experiment experiment) Whether a script is using an experiment.register(SkriptAddon addon, String codeName, LifeCycle phase, String... patterns) Creates (and registers) a new experimental feature flag, which will be available to scripts with theusing %name%structure.voidregister(SkriptAddon addon, Experiment experiment) Registers a new experimental feature flag, which will be available to scripts with theusing %name%structure.voidregisterAll(SkriptAddon addon, Experiment... experiments) voidunregister(SkriptAddon addon, Experiment experiment) Unregisters an experimental feature flag.
-
Constructor Details
-
ExperimentRegistry
-
-
Method Details
-
find
Finds an experiment matching this name. If none exist, an 'unknown' one will be created.- Parameters:
text- The text provided by the user.- Returns:
- An experiment.
-
registered
- Returns:
- All currently-registered experiments.
-
register
Registers a new experimental feature flag, which will be available to scripts with theusing %name%structure.- Parameters:
addon- The source of this feature.experiment- The experimental feature flag.
-
registerAll
- See Also:
-
unregister
Unregisters an experimental feature flag. Loaded scripts currently using the flag will not have it disabled.- Parameters:
addon- The source of this feature.experiment- The experimental feature flag.
-
register
Creates (and registers) a new experimental feature flag, which will be available to scripts with theusing %name%structure.- Parameters:
addon- The source of this feature.codeName- The debug 'code name' of this feature.phase- The stability of this feature.patterns- What the user may write to match the feature. Defaults to the codename if not set.- Returns:
- An experiment flag.
-
hasExperiment
- Specified by:
hasExperimentin interfaceExperimented- Parameters:
experiment- The experimental feature to test.- Returns:
- Whether this uses the given feature.
-
hasExperiment
- Specified by:
hasExperimentin interfaceExperimented- Parameters:
featureName- The name of the experimental feature to test.- Returns:
- Whether this has a feature with the given name.
-
isUsing
Whether a script is using an experiment.- Parameters:
script- The script to testexperiment- The experimental flag- Returns:
- Whether the script declared itself as `using X`
-
isUsing
Whether a script is using an experiment.- Parameters:
script- The script to testfeatureName- The experimental flag's name- Returns:
- Whether the script declared itself as `using X`
-