Class ArenaConditionVariableValue<T>

java.lang.Object
de.marcely.bedwars.api.arena.picker.condition.variable.ArenaConditionVariableValue<T>
Type Parameters:
T -
Direct Known Subclasses:
ArenaConditionVariableValueNumber, ArenaConditionVariableValueString

public abstract class ArenaConditionVariableValue<T> extends Object
Represents a value that may be used to compare.

It may be manually constructed by using either its inheritances or ArenaConditionVariable.

  • Field Details

  • Constructor Details

    • ArenaConditionVariableValue

      public ArenaConditionVariableValue(T entry)
  • Method Details

    • getEntry

      public T getEntry()
      Returns the actual data that this wrapper is holding.
      Returns:
      The data that this instance represents
    • getType

      public abstract byte getType()
      The type of this class.

      You may find them as fields within this class, e.g. TYPE_NUMBER.

      Returns:
      The type of this equal
    • equal

      public abstract boolean equal(T entry)
      Parameters:
      entry - The second value of the same type
      Returns:
      true in case the operation succeded
    • notEqual

      public abstract boolean notEqual(T entry)
      Parameters:
      entry - The second value of the same type
      Returns:
      true in case the operation succeded
    • greaterThan

      public abstract boolean greaterThan(T entry)
      Parameters:
      entry - The second value of the same type
      Returns:
      true in case the operation succeded
    • lessThan

      public abstract boolean lessThan(T entry)
      Parameters:
      entry - The second value of the same type
      Returns:
      true in case the operation succeded
    • greaterThanOrEqual

      public abstract boolean greaterThanOrEqual(T entry)
      Parameters:
      entry - The second value of the same type
      Returns:
      true in case the operation succeded
    • lessThanOrEqual

      public abstract boolean lessThanOrEqual(T entry)
      Parameters:
      entry - The second value of the same type
      Returns:
      true in case the operation succeded
    • check

      public boolean check(ArenaConditionComparisonOperator operator, ArenaConditionVariableValue<?> secondValue)
      Automatically executes the correct operation method given the passed operator.

      Additionally does an unsafe casting from a generic value object.

      Parameters:
      operator - The operation that shall be done
      secondValue - The second value
      Returns:
      true in case the operation succeded