K
- The key of the propertyV
- The type of the value of the propertypublic interface Property<K,V> extends Comparable<Property<?,?>>
Modifier and Type | Interface and Description |
---|---|
static class |
Property.Operator
Operator used to indicate to a query what operation to use when comparing
this property with properties present on an item stack.
|
Modifier and Type | Method and Description |
---|---|
K |
getKey()
Gets the key for this property.
|
Property.Operator |
getOperator()
Gets the operator to use when comparing another property with this
property.
|
V |
getValue()
Gets the "value" of this property.
|
boolean |
matches(Property<?,?> other)
Compares this property to
other using this property's
operator. |
compareTo
K getKey()
@Nullable V getValue()
Property.Operator getOperator()
boolean matches(@Nullable Property<?,?> other)
Compares this property to other
using this property's
operator. This is equivalent to the code:
thisObject.getOperator().compare(thisObject, other);
The order of the operands is important, since Property.Operator
treats
its type as infix between the two operands, and thus (for example) if
this property's operator is set to GREATER, then when calling this method
we want to know whether this is GREATER than other
and must pass in the operands in the corresponding order.
other
- Property to compare togetOperator()