Interface Conditional

All Known Implementing Classes:
LogicalConditional, NumericConditional

public interface Conditional
The interface to represent a comparison
  • Method Details

    • compute

      boolean compute(org.bukkit.entity.Player player)
      Computes the condition to determine if the action should be executed
      Parameters:
      player - The player to fetch data from
      Returns:
      if the action should be executed
    • toJson

      String toJson()
      Serializes the condition to json using Gson
      Returns:
      the serialized condition
    • of

      static Conditional of(String data)
      Parameters:
      data - the serialized condition
      Returns:
      the condition from the json
    • getValue

      Conditional.Value getValue()
      Gets the value the condition is comparing
      Returns:
      the value the condition is comparing
      See Also:
    • getComparator

      Conditional.Comparator getComparator()
      Gets the comparator the condition uses to compare the value and target value.
      Returns:
      the comparator
      See Also:
    • getType

      Conditional.Type getType()
      Gets the type of condition
      Returns:
      the condition type
      See Also:
    • setComparator

      void setComparator(Conditional.Comparator comparator)
      Sets the comparator of this condition
      Parameters:
      comparator - the comparator to compare the value and target value
      See Also:
    • setValue

      void setValue(Conditional.Value value)
      Sets the value of this condition
      Parameters:
      value - the value to compare
      See Also:
    • setTargetValue

      void setTargetValue(String targetValue)
      Sets the target value of this condition
      Parameters:
      targetValue - the target value
    • getTarget

      String getTarget()
      Gets the target of the condition
      Returns:
      returns the target value
    • clone

      Conditional clone()
      Clones this conditional object
      Returns:
      the cloned object