Class Experiment

java.lang.Object
ua.mcchickenstudio.opencreative.commands.experiments.Experiment
Direct Known Subclasses:
CodeDownloaderExperiment, TestificationExperiment, WandersExperiment, WorldDownloaderExperiment

public abstract class Experiment extends Object

Experiment

Represents an experimental feature, that can be enabled in settings for testing new content.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract @NotNull String
    Returns description of experiment, that will tell purpose of experiment and describes what it adds.
    abstract @NotNull String
    Returns id of experiment.
    abstract @NotNull String
    Returns name of experiment, that will be used for displaying in experiments list.
    abstract void
    handleCommand(@NotNull org.bukkit.command.CommandSender sender, @NotNull String[] args)
    Handles command for experiment.
    int
     
    boolean
    Checks whether experiment is enabled or not.
    void
    Executes disable operations for experiment.
    void
    Executes enable operations for experiment.
    void
    setEnabled(boolean enabled)
    Sets enabled state of experiment.
    abstract @Nullable List<String>
    tabCommand(@NotNull org.bukkit.command.CommandSender sender, @NotNull String[] args)
    Returns list of command suggestions for experiment.
     

    Methods inherited from class Object

    clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Experiment

      public Experiment()
  • Method Details

    • getId

      @NotNull public abstract @NotNull String getId()
      Returns id of experiment.
      Returns:
      short id of experiment that will be used in settings.

      It must be lower-snake-cased, for example: "future_update", "code_downloader".

    • getName

      @NotNull public abstract @NotNull String getName()
      Returns name of experiment, that will be used for displaying in experiments list.
      Returns:
      name of experiment.
    • getDescription

      @NotNull public abstract @NotNull String getDescription()
      Returns description of experiment, that will tell purpose of experiment and describes what it adds.
      Returns:
      description of content in experiment.
    • handleCommand

      public abstract void handleCommand(@NotNull @NotNull org.bukkit.command.CommandSender sender, @NotNull @NotNull String[] args)
      Handles command for experiment.
      Parameters:
      sender - sender of command.
      args - arguments of command.
    • tabCommand

      @Nullable public abstract @Nullable List<String> tabCommand(@NotNull @NotNull org.bukkit.command.CommandSender sender, @NotNull @NotNull String[] args)
      Returns list of command suggestions for experiment.
      Parameters:
      sender - sender of command.
      args - arguments of command.
      Returns:
      list of command suggestions.
    • onEnable

      public void onEnable()
      Executes enable operations for experiment.
    • onDisable

      public void onDisable()
      Executes disable operations for experiment.
    • isEnabled

      public boolean isEnabled()
      Checks whether experiment is enabled or not.
      Returns:
      true - enabled, false - disabled.
    • setEnabled

      public void setEnabled(boolean enabled)
      Sets enabled state of experiment.
      Parameters:
      enabled - true - enabled, false - disabled.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object