public class Criterion extends Object implements Serializable
When data is dragged over a drop target, the value here is compared to the payload added in DropTargetExtension with same key and value type.
| Modifier and Type | Class and Description |
|---|---|
static class |
Criterion.Match
Declares whether all or any of the given criteria should match when
compared against the payload.
|
| Constructor and Description |
|---|
Criterion(String key,
ComparisonOperator operator,
double value)
Creates a criterion object.
|
Criterion(String key,
ComparisonOperator operator,
int value)
Creates a criterion object.
|
Criterion(String key,
String value)
Creates a criterion object with the default comparison operator
ComparisonOperator.EQUALS. |
| Modifier and Type | Method and Description |
|---|---|
String |
getKey()
Gets the key of the payload to be compared
|
ComparisonOperator |
getOperator()
Gets the comparison operator.
|
String |
getValue()
Gets the value of the payload to be compared
|
Payload.ValueType |
getValueType()
Gets the type of the payload value to be compared
|
boolean |
resolve(Collection<Payload> payloadCollection)
Compares this criterion's value to the given payload's value and returns
whether the result matches the criterion's operator.
|
public Criterion(String key, String value)
ComparisonOperator.EQUALS.key - key of the payload to be comparedvalue - value of the payload to be comparedpublic Criterion(String key, ComparisonOperator operator, int value)
key - key of the payload to be comparedoperator - comparison operatorvalue - value of the payload to be comparedpublic Criterion(String key, ComparisonOperator operator, double value)
key - key of the payload to be comparedoperator - comparison operatorvalue - value of the payload to be comparedpublic String getKey()
public String getValue()
public Payload.ValueType getValueType()
public ComparisonOperator getOperator()
public boolean resolve(Collection<Payload> payloadCollection)
payloadCollection - collection of payloads to compare the criterion againstfalse if there exists a payload in the collection with
the same key and value type and it doesn't match the criterion, true otherwiseCopyright © 2017 Vaadin Ltd. All rights reserved.