diff options
author | Anna Koskinen <Ansku@users.noreply.github.com> | 2020-03-26 14:55:49 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-26 14:55:49 +0200 |
commit | 76291c6ff3bf9b54118e0f03b02cf62c7c897a20 (patch) | |
tree | 82d979a3e35377ab9094a7dbc134cc4cf93d2563 /shared | |
parent | 65e8228464237fbbced0829df112e8f6b03f36d3 (diff) | |
download | vaadin-framework-76291c6ff3bf9b54118e0f03b02cf62c7c897a20.tar.gz vaadin-framework-76291c6ff3bf9b54118e0f03b02cf62c7c897a20.zip |
Add setters to Criterion to fix serialization. (#11926) (#11931)
Fixes #11909
Diffstat (limited to 'shared')
-rw-r--r-- | shared/src/main/java/com/vaadin/shared/ui/dnd/criteria/Criterion.java | 48 |
1 files changed, 44 insertions, 4 deletions
diff --git a/shared/src/main/java/com/vaadin/shared/ui/dnd/criteria/Criterion.java b/shared/src/main/java/com/vaadin/shared/ui/dnd/criteria/Criterion.java index 73c022a033..e734a5edc1 100644 --- a/shared/src/main/java/com/vaadin/shared/ui/dnd/criteria/Criterion.java +++ b/shared/src/main/java/com/vaadin/shared/ui/dnd/criteria/Criterion.java @@ -116,10 +116,10 @@ public class Criterion implements Serializable { */ private Criterion(String key, ComparisonOperator operator, String value, Payload.ValueType valueType) { - this.key = key; - this.value = value; - this.valueType = valueType; - this.operator = operator; + setKey(key); + setValue(value); + setValueType(valueType); + setOperator(operator); } /** @@ -132,6 +132,16 @@ public class Criterion implements Serializable { } /** + * Sets the key of the payload to be compared. + * + * @param key + * key of the payload to be compared + */ + public void setKey(String key) { + this.key = key; + } + + /** * Gets the value of the payload to be compared. * * @return value of the payload to be compared @@ -141,6 +151,16 @@ public class Criterion implements Serializable { } /** + * Sets the value of the payload to be compared. + * + * @param value + * value of the payload to be compared + */ + public void setValue(String value) { + this.value = value; + } + + /** * Gets the type of the payload value to be compared. * * @return type of the payload value to be compared @@ -150,6 +170,16 @@ public class Criterion implements Serializable { } /** + * Sets the type of the payload value to be compared. + * + * @param valueType + * type of the payload to be compared + */ + public void setValueType(Payload.ValueType valueType) { + this.valueType = valueType; + } + + /** * Gets the comparison operator. * * @return operator to be used when comparing payload value with criterion @@ -159,6 +189,16 @@ public class Criterion implements Serializable { } /** + * Sets the comparison operator. + * + * @param operator + * comparison operator + */ + public void setOperator(ComparisonOperator operator) { + this.operator = operator; + } + + /** * Compares this criterion's value to the given payload's value and returns * whether the result matches the criterion's operator. The comparison is * done with the payload whose key and value type match the criterion's key |