Class ArenaConditionVariableValue<T>
java.lang.Object
de.marcely.bedwars.api.arena.picker.condition.variable.ArenaConditionVariableValue<T>
- Type Parameters:
T
- The actual value that it is holding. E.g.String
forArenaConditionVariableValueString
- Direct Known Subclasses:
ArenaConditionVariableValueNumber
,ArenaConditionVariableValueString
Represents a value that may be used to compare.
It may be manually constructed by using either its inheritances or ArenaConditionVariable
.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
check
(ArenaConditionComparisonOperator operator, ArenaConditionVariableValue<?> secondValue) Automatically executes the correct operation method given the passed operator.abstract boolean
Does aArenaConditionComparisonOperator.EQUAL
operation.getEntry()
Returns the actual data that this wrapper is holding.abstract byte
getType()
The type of this class.abstract boolean
greaterThan
(T entry) Does aArenaConditionComparisonOperator.GREATER_THAN
operation.abstract boolean
greaterThanOrEqual
(T entry) Does aArenaConditionComparisonOperator.GREATER_THAN_OR_EQUAL
operation.abstract boolean
Does aArenaConditionComparisonOperator.LESS_THAN
operation.abstract boolean
lessThanOrEqual
(T entry) Does aArenaConditionComparisonOperator.LESS_THAN_OR_EQUAL
operation.abstract boolean
Does aArenaConditionComparisonOperator.NOT_EQUAL
operation.
-
Field Details
-
TYPE_NUMBER
public static final byte TYPE_NUMBER- See Also:
-
TYPE_STRING
public static final byte TYPE_STRING- See Also:
-
entry
-
-
Constructor Details
-
ArenaConditionVariableValue
-
-
Method Details
-
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
Does aArenaConditionComparisonOperator.EQUAL
operation.- Parameters:
entry
- The second value of the same type- Returns:
true
in case the operation succeded
-
notEqual
Does aArenaConditionComparisonOperator.NOT_EQUAL
operation.- Parameters:
entry
- The second value of the same type- Returns:
true
in case the operation succeded
-
greaterThan
Does aArenaConditionComparisonOperator.GREATER_THAN
operation.- Parameters:
entry
- The second value of the same type- Returns:
true
in case the operation succeded
-
lessThan
Does aArenaConditionComparisonOperator.LESS_THAN
operation.- Parameters:
entry
- The second value of the same type- Returns:
true
in case the operation succeded
-
greaterThanOrEqual
Does aArenaConditionComparisonOperator.GREATER_THAN_OR_EQUAL
operation.- Parameters:
entry
- The second value of the same type- Returns:
true
in case the operation succeded
-
lessThanOrEqual
Does aArenaConditionComparisonOperator.LESS_THAN_OR_EQUAL
operation.- 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 donesecondValue
- The second value- Returns:
true
in case the operation succeded
-