/** Use this constructor when the RegExp failed to convert to an automaton. */ public TooComplexToDeterminizeException(RegExp regExp, TooComplexToDeterminizeException cause) { super("Determinizing " + regExp.getOriginalString() + " would result in more than " + cause.maxDeterminizedStates + " states.", cause); this.regExp = regExp; this.automaton = cause.automaton; this.maxDeterminizedStates = cause.maxDeterminizedStates; }
@Override public int hashCode() { return Objects.hash( include == null ? null : include.getOriginalString(), exclude == null ? null : exclude.getOriginalString(), includeValues, excludeValues, incZeroBasedPartition, incNumPartitions); }
@Override public boolean equals(Object obj) { if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } IncludeExclude other = (IncludeExclude) obj; return Objects.equals(include == null ? null : include.getOriginalString(), other.include == null ? null : other.include.getOriginalString()) && Objects.equals(exclude == null ? null : exclude.getOriginalString(), other.exclude == null ? null : other.exclude.getOriginalString()) && Objects.equals(includeValues, other.includeValues) && Objects.equals(excludeValues, other.excludeValues) && Objects.equals(incZeroBasedPartition, other.incZeroBasedPartition) && Objects.equals(incNumPartitions, other.incNumPartitions); }
@Override public void writeTo(StreamOutput out) throws IOException { boolean regexBased = isRegexBased(); out.writeBoolean(regexBased); if (regexBased) { out.writeOptionalString(include == null ? null : include.getOriginalString()); out.writeOptionalString(exclude == null ? null : exclude.getOriginalString()); } else { boolean hasIncludes = includeValues != null; out.writeBoolean(hasIncludes); if (hasIncludes) { out.writeVInt(includeValues.size()); for (BytesRef value : includeValues) { out.writeBytesRef(value); } } boolean hasExcludes = excludeValues != null; out.writeBoolean(hasExcludes); if (hasExcludes) { out.writeVInt(excludeValues.size()); for (BytesRef value : excludeValues) { out.writeBytesRef(value); } } if (out.getVersion().onOrAfter(Version.V_5_2_0)) { out.writeVInt(incNumPartitions); out.writeVInt(incZeroBasedPartition); } } }
/** Use this constructor when the RegExp failed to convert to an automaton. */ public TooComplexToDeterminizeException(RegExp regExp, TooComplexToDeterminizeException cause) { super("Determinizing " + regExp.getOriginalString() + " would result in more than " + cause.maxDeterminizedStates + " states.", cause); this.regExp = regExp; this.automaton = cause.automaton; this.maxDeterminizedStates = cause.maxDeterminizedStates; }
/** Use this constructor when the RegExp failed to convert to an automaton. */ public TooComplexToDeterminizeException(RegExp regExp, TooComplexToDeterminizeException cause) { super("Determinizing " + regExp.getOriginalString() + " would result in more than " + cause.maxDeterminizedStates + " states.", cause); this.regExp = regExp; this.automaton = cause.automaton; this.maxDeterminizedStates = cause.maxDeterminizedStates; }
/** Use this constructor when the RegExp failed to convert to an automaton. */ public TooComplexToDeterminizeException(RegExp regExp, TooComplexToDeterminizeException cause) { super("Determinizing " + regExp.getOriginalString() + " would result in more than " + cause.maxDeterminizedStates + " states.", cause); this.regExp = regExp; this.automaton = cause.automaton; this.maxDeterminizedStates = cause.maxDeterminizedStates; }
@Override public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { if (include != null) { builder.field(INCLUDE_FIELD.getPreferredName(), include.getOriginalString()); } else if (includeValues != null) { builder.startArray(INCLUDE_FIELD.getPreferredName()); for (BytesRef value : includeValues) { builder.value(value.utf8ToString()); } builder.endArray(); } else if (isPartitionBased()) { builder.startObject(INCLUDE_FIELD.getPreferredName()); builder.field(PARTITION_FIELD.getPreferredName(), incZeroBasedPartition); builder.field(NUM_PARTITIONS_FIELD.getPreferredName(), incNumPartitions); builder.endObject(); } if (exclude != null) { builder.field(EXCLUDE_FIELD.getPreferredName(), exclude.getOriginalString()); } else if (excludeValues != null) { builder.startArray(EXCLUDE_FIELD.getPreferredName()); for (BytesRef value : excludeValues) { builder.value(value.utf8ToString()); } builder.endArray(); } return builder; }
@Override public int hashCode() { return Objects.hash( include == null ? null : include.getOriginalString(), exclude == null ? null : exclude.getOriginalString(), includeValues, excludeValues, incZeroBasedPartition, incNumPartitions); }
@Override public int hashCode() { return Objects.hash( include == null ? null : include.getOriginalString(), exclude == null ? null : exclude.getOriginalString(), includeValues, excludeValues, incZeroBasedPartition, incNumPartitions); }
@Override public int hashCode() { return Objects.hash( include == null ? null : include.getOriginalString(), exclude == null ? null : exclude.getOriginalString(), includeValues, excludeValues, incZeroBasedPartition, incNumPartitions); }
@Override public int hashCode() { return Objects.hash( include == null ? null : include.getOriginalString(), exclude == null ? null : exclude.getOriginalString(), includeValues, excludeValues, incZeroBasedPartition, incNumPartitions); }
@Override public boolean equals(Object obj) { if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } IncludeExclude other = (IncludeExclude) obj; return Objects.equals(include == null ? null : include.getOriginalString(), other.include == null ? null : other.include.getOriginalString()) && Objects.equals(exclude == null ? null : exclude.getOriginalString(), other.exclude == null ? null : other.exclude.getOriginalString()) && Objects.equals(includeValues, other.includeValues) && Objects.equals(excludeValues, other.excludeValues) && Objects.equals(incZeroBasedPartition, other.incZeroBasedPartition) && Objects.equals(incNumPartitions, other.incNumPartitions); }
@Override public boolean equals(Object obj) { if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } IncludeExclude other = (IncludeExclude) obj; return Objects.equals(include == null ? null : include.getOriginalString(), other.include == null ? null : other.include.getOriginalString()) && Objects.equals(exclude == null ? null : exclude.getOriginalString(), other.exclude == null ? null : other.exclude.getOriginalString()) && Objects.equals(includeValues, other.includeValues) && Objects.equals(excludeValues, other.excludeValues) && Objects.equals(incZeroBasedPartition, other.incZeroBasedPartition) && Objects.equals(incNumPartitions, other.incNumPartitions); }
@Override public boolean equals(Object obj) { if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } IncludeExclude other = (IncludeExclude) obj; return Objects.equals(include == null ? null : include.getOriginalString(), other.include == null ? null : other.include.getOriginalString()) && Objects.equals(exclude == null ? null : exclude.getOriginalString(), other.exclude == null ? null : other.exclude.getOriginalString()) && Objects.equals(includeValues, other.includeValues) && Objects.equals(excludeValues, other.excludeValues) && Objects.equals(incZeroBasedPartition, other.incZeroBasedPartition) && Objects.equals(incNumPartitions, other.incNumPartitions); }
@Override public boolean equals(Object obj) { if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } IncludeExclude other = (IncludeExclude) obj; return Objects.equals(include == null ? null : include.getOriginalString(), other.include == null ? null : other.include.getOriginalString()) && Objects.equals(exclude == null ? null : exclude.getOriginalString(), other.exclude == null ? null : other.exclude.getOriginalString()) && Objects.equals(includeValues, other.includeValues) && Objects.equals(excludeValues, other.excludeValues) && Objects.equals(incZeroBasedPartition, other.incZeroBasedPartition) && Objects.equals(incNumPartitions, other.incNumPartitions); }
@Override public void writeTo(StreamOutput out) throws IOException { boolean regexBased = isRegexBased(); out.writeBoolean(regexBased); if (regexBased) { out.writeOptionalString(include == null ? null : include.getOriginalString()); out.writeOptionalString(exclude == null ? null : exclude.getOriginalString()); } else { boolean hasIncludes = includeValues != null; out.writeBoolean(hasIncludes); if (hasIncludes) { out.writeVInt(includeValues.size()); for (BytesRef value : includeValues) { out.writeBytesRef(value); } } boolean hasExcludes = excludeValues != null; out.writeBoolean(hasExcludes); if (hasExcludes) { out.writeVInt(excludeValues.size()); for (BytesRef value : excludeValues) { out.writeBytesRef(value); } } if (out.getVersion().onOrAfter(Version.V_5_2_0)) { out.writeVInt(incNumPartitions); out.writeVInt(incZeroBasedPartition); } } }
@Override public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { if (include != null) { builder.field(INCLUDE_FIELD.getPreferredName(), include.getOriginalString()); } else if (includeValues != null) { builder.startArray(INCLUDE_FIELD.getPreferredName()); for (BytesRef value : includeValues) { builder.value(value.utf8ToString()); } builder.endArray(); } else if (isPartitionBased()) { builder.startObject(INCLUDE_FIELD.getPreferredName()); builder.field(PARTITION_FIELD.getPreferredName(), incZeroBasedPartition); builder.field(NUM_PARTITIONS_FIELD.getPreferredName(), incNumPartitions); builder.endObject(); } if (exclude != null) { builder.field(EXCLUDE_FIELD.getPreferredName(), exclude.getOriginalString()); } else if (excludeValues != null) { builder.startArray(EXCLUDE_FIELD.getPreferredName()); for (BytesRef value : excludeValues) { builder.value(value.utf8ToString()); } builder.endArray(); } return builder; }
@Override public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { if (include != null) { builder.field(INCLUDE_FIELD.getPreferredName(), include.getOriginalString()); } else if (includeValues != null) { builder.startArray(INCLUDE_FIELD.getPreferredName()); for (BytesRef value : includeValues) { builder.value(value.utf8ToString()); } builder.endArray(); } else if (isPartitionBased()) { builder.startObject(INCLUDE_FIELD.getPreferredName()); builder.field(PARTITION_FIELD.getPreferredName(), incZeroBasedPartition); builder.field(NUM_PARTITIONS_FIELD.getPreferredName(), incNumPartitions); builder.endObject(); } if (exclude != null) { builder.field(EXCLUDE_FIELD.getPreferredName(), exclude.getOriginalString()); } else if (excludeValues != null) { builder.startArray(EXCLUDE_FIELD.getPreferredName()); for (BytesRef value : excludeValues) { builder.value(value.utf8ToString()); } builder.endArray(); } return builder; }
@Override public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { if (include != null) { builder.field(INCLUDE_FIELD.getPreferredName(), include.getOriginalString()); } else if (includeValues != null) { builder.startArray(INCLUDE_FIELD.getPreferredName()); for (BytesRef value : includeValues) { builder.value(value.utf8ToString()); } builder.endArray(); } else if (isPartitionBased()) { builder.startObject(INCLUDE_FIELD.getPreferredName()); builder.field(PARTITION_FIELD.getPreferredName(), incZeroBasedPartition); builder.field(NUM_PARTITIONS_FIELD.getPreferredName(), incNumPartitions); builder.endObject(); } if (exclude != null) { builder.field(EXCLUDE_FIELD.getPreferredName(), exclude.getOriginalString()); } else if (excludeValues != null) { builder.startArray(EXCLUDE_FIELD.getPreferredName()); for (BytesRef value : excludeValues) { builder.value(value.utf8ToString()); } builder.endArray(); } return builder; }