public RangeQueryBuilder relation(String relation) { if (relation == null) { throw new IllegalArgumentException("relation cannot be null"); } this.relation = ShapeRelation.getRelationByName(relation); if (this.relation == null) { throw new IllegalArgumentException(relation + " is not a valid relation"); } if (!isRelationAllowed(this.relation)) { throw new IllegalArgumentException("[range] query does not support relation [" + relation + "]"); } return this; }
/** * Read from a stream. */ public RangeQueryBuilder(StreamInput in) throws IOException { super(in); fieldName = in.readString(); from = in.readGenericValue(); to = in.readGenericValue(); includeLower = in.readBoolean(); includeUpper = in.readBoolean(); timeZone = in.readOptionalTimeZone(); String formatString = in.readOptionalString(); if (formatString != null) { format = DateFormatter.forPattern(formatString); } if (in.getVersion().onOrAfter(Version.V_5_2_0)) { String relationString = in.readOptionalString(); if (relationString != null) { relation = ShapeRelation.getRelationByName(relationString); if (relation != null && !isRelationAllowed(relation)) { throw new IllegalArgumentException( "[range] query does not support relation [" + relationString + "]"); } } } }
public RangeQueryBuilder relation(String relation) { if (relation == null) { throw new IllegalArgumentException("relation cannot be null"); } this.relation = ShapeRelation.getRelationByName(relation); if (this.relation == null) { throw new IllegalArgumentException(relation + " is not a valid relation"); } if (!isRelationAllowed(this.relation)) { throw new IllegalArgumentException("[range] query does not support relation [" + relation + "]"); } return this; }
public RangeQueryBuilder relation(String relation) { if (relation == null) { throw new IllegalArgumentException("relation cannot be null"); } this.relation = ShapeRelation.getRelationByName(relation); if (this.relation == null) { throw new IllegalArgumentException(relation + " is not a valid relation"); } if (!isRelationAllowed(this.relation)) { throw new IllegalArgumentException("[range] query does not support relation [" + relation + "]"); } return this; }
/** * Read from a stream. */ public RangeQueryBuilder(StreamInput in) throws IOException { super(in); fieldName = in.readString(); from = in.readGenericValue(); to = in.readGenericValue(); includeLower = in.readBoolean(); includeUpper = in.readBoolean(); timeZone = in.readOptionalTimeZone(); String formatString = in.readOptionalString(); if (formatString != null) { format = Joda.forPattern(formatString); } if (in.getVersion().onOrAfter(Version.V_5_2_0)) { String relationString = in.readOptionalString(); if (relationString != null) { relation = ShapeRelation.getRelationByName(relationString); if (relation != null && !isRelationAllowed(relation)) { throw new IllegalArgumentException( "[range] query does not support relation [" + relationString + "]"); } } } }
/** * Read from a stream. */ public RangeQueryBuilder(StreamInput in) throws IOException { super(in); fieldName = in.readString(); from = in.readGenericValue(); to = in.readGenericValue(); includeLower = in.readBoolean(); includeUpper = in.readBoolean(); timeZone = in.readOptionalTimeZone(); String formatString = in.readOptionalString(); if (formatString != null) { format = Joda.forPattern(formatString); } if (in.getVersion().onOrAfter(Version.V_5_2_0)) { String relationString = in.readOptionalString(); if (relationString != null) { relation = ShapeRelation.getRelationByName(relationString); if (relation != null && !isRelationAllowed(relation)) { throw new IllegalArgumentException( "[range] query does not support relation [" + relationString + "]"); } } } }