Class AbstractPipePart.Option<T>

java.lang.Object
io.github.apfelcreme.Pipes.Pipe.AbstractPipePart.Option<T>
Enclosing class:
AbstractPipePart

public static class AbstractPipePart.Option<T>
extends Object
  • Method Details

    • name

      public String name()
    • getValueType

      public Class<?> getValueType()
      Get the class of the values that this option accepts
      Returns:
      The class of the values that this option accepts
    • getDefaultValue

      public AbstractPipePart.Value<T> getDefaultValue()
      Get the default value for this option if it isn't set
      Returns:
      The default value of this option
    • getPossibleValues

      public AbstractPipePart.Value<T>[] getPossibleValues()
      Get the array of possible values
      Returns:
      The array of possible values
    • getTagType

      public <Z> org.bukkit.persistence.PersistentDataType<Z,​T> getTagType()
      Get the persistent data type of the option
      Type Parameters:
      Z - The primitive value for NBT
      Returns:
      The persistent data type
    • toConfigKey

      public String toConfigKey()
      Get the enum name as a lowercase string with underscores replaced with dashes
      Returns:
      The enum name as a config key
    • isValid

      public boolean isValid​(AbstractPipePart.Value<?> value)
      Check whether or not this option can be set to a value
      Parameters:
      value - The value to check
      Returns:
      true if this option accepts it; false otherwhise
    • getElement

      public de.themoep.inventorygui.GuiStateElement getElement​(AbstractPipePart pipePart)
      Get the GUI element of this option for a certain pipe part
      Parameters:
      pipePart - The pipe part to get the element for
      Returns:
      The GuiStateElement of this option
    • getGuiPosition

      public io.github.apfelcreme.Pipes.Pipe.AbstractPipePart.Option.GuiPosition getGuiPosition()
      Get the position where to display this option in the GUI
      Returns:
      The position to display this option in the GUI in
    • store

      public void store​(AbstractPipePart pipePart, org.bukkit.persistence.PersistentDataContainer container)
      Store the value of an option of a certain PipePart to a PersistentDataContiner
      Parameters:
      pipePart - The PipePart to store the option value from
      container - The container to store the option value to
    • set

      public void set​(org.bukkit.persistence.PersistentDataContainer container, AbstractPipePart.Value<T> value)
      Set the value in a specific container
      Parameters:
      container - The container to store the option value to
      value - The value to store
    • parseValue

      public AbstractPipePart.Value<T> parseValue​(Object object) throws IllegalArgumentException
      Parse the value for this option from an object
      Parameters:
      object - The object to parse the value from
      Returns:
      The parsed Value
      Throws:
      IllegalArgumentException - thrown if the object can't be parsed