- /**
- * The name of the field to apply the range query against.
- */
- private String field;
-
- /**
- * The value of the field must be greater than this value to be a match.<br>
- * NOTE: Only one of 'gt' or 'gte' should be set on any single {@link RangeQuery}
- * instance.
- */
- private Object gt;
-
- /**
- * The value of the field must be greater than or equal to this value to be a match.<br>
- * NOTE: Only one of 'gt' or 'gte' should be set on any single {@link RangeQuery}
- * instance.
- */
- private Object gte;
-
- /**
- * The value of the field must be less than this value to be a match.<br>
- * NOTE: Only one of 'lt' or 'lte' should be set on any single {@link RangeQuery}
- * instance.
- */
- private Object lt;
-
- /**
- * The value of the field must be less than or equal to than this value to be a match.<br>
- * NOTE: Only one of 'lt' or 'lte' should be set on any single {@link RangeQuery}
- * instance.
- */
- private Object lte;
-
- private String format;
-
- @JsonProperty("time-zone")
- private String timeZone;
-
- public String getField() {
- return field;
- }
-
- public void setField(String field) {
- this.field = field;
- }
-
- public Object getGt() {
- return gt;
- }
-
- public void setGt(Object gt) {
-
- // It does not make sense to assign a value to both the 'greater than'
- // and 'greater than or equal' operations, so make sure we are not
- // trying to do that.
- if (gte == null) {
-
- // Make sure that we are not trying to mix both numeric and date
- // type values in the same queries.
- if (((lt != null) && !typesMatch(gt, lt))
- || ((lte != null) && !typesMatch(gt, lte))) {
- throw new IllegalArgumentException("Cannot mix date and numeric values in the same ranged query");
- }
-
- // If we made it here, then we're all good. Store the value.
- this.gt = gt;
- } else {
- throw new IllegalArgumentException("Cannot assign both 'gt' and 'gte' fields in the same ranged query");
+ /**
+ * The name of the field to apply the range query against.
+ */
+ private String field;
+
+ /**
+ * The value of the field must be greater than this value to be a match.<br>
+ * NOTE: Only one of 'gt' or 'gte' should be set on any single {@link RangeQuery} instance.
+ */
+ private Object gt;
+
+ /**
+ * The value of the field must be greater than or equal to this value to be a match.<br>
+ * NOTE: Only one of 'gt' or 'gte' should be set on any single {@link RangeQuery} instance.
+ */
+ private Object gte;
+
+ /**
+ * The value of the field must be less than this value to be a match.<br>
+ * NOTE: Only one of 'lt' or 'lte' should be set on any single {@link RangeQuery} instance.
+ */
+ private Object lt;
+
+ /**
+ * The value of the field must be less than or equal to than this value to be a match.<br>
+ * NOTE: Only one of 'lt' or 'lte' should be set on any single {@link RangeQuery} instance.
+ */
+ private Object lte;
+
+ private String format;
+
+ @JsonProperty("time-zone")
+ private String timeZone;
+
+ public String getField() {
+ return field;