aboutsummaryrefslogtreecommitdiffstats
path: root/shared
diff options
context:
space:
mode:
authorAnna Koskinen <Ansku@users.noreply.github.com>2020-03-26 10:51:19 +0200
committerGitHub <noreply@github.com>2020-03-26 10:51:19 +0200
commitb1ff64c6fd97359056adfccf7dc06eb3116e9e10 (patch)
tree45aeb8c3f059213b2a43544a67298e617e4f5439 /shared
parentf96263b21c3440f02d55c6d37a89a354c3093bdb (diff)
downloadvaadin-framework-b1ff64c6fd97359056adfccf7dc06eb3116e9e10.tar.gz
vaadin-framework-b1ff64c6fd97359056adfccf7dc06eb3116e9e10.zip
Add setters to Criterion to fix serialization. (#11926)
Fixes #11909
Diffstat (limited to 'shared')
-rw-r--r--shared/src/main/java/com/vaadin/shared/ui/dnd/criteria/Criterion.java48
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