Replace writeOptionalQuery with writeOptionalNamedWriteable
This commit is contained in:
parent
8cffe0fc28
commit
70d55b36e1
|
@ -730,7 +730,7 @@ public abstract class StreamInput extends InputStream {
|
|||
}
|
||||
|
||||
/**
|
||||
* Reads an optional {@link QueryBuilder}.
|
||||
* Reads an optional {@link NamedWriteable}.
|
||||
*/
|
||||
public <C extends NamedWriteable<?>> C readOptionalNamedWriteable(Class<C> categoryClass) throws IOException {
|
||||
if (readBoolean()) {
|
||||
|
|
|
@ -692,6 +692,18 @@ public abstract class StreamOutput extends OutputStream {
|
|||
namedWriteable.writeTo(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Write an optional {@link QueryBuilder} to the stream.
|
||||
*/
|
||||
public void writeOptionalNamedWriteable(@Nullable NamedWriteable<?> namedWriteable) throws IOException {
|
||||
if (namedWriteable == null) {
|
||||
writeBoolean(false);
|
||||
} else {
|
||||
writeBoolean(true);
|
||||
writeNamedWriteable(namedWriteable);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes a {@link AggregatorBuilder} to the current stream
|
||||
*/
|
||||
|
@ -713,18 +725,6 @@ public abstract class StreamOutput extends OutputStream {
|
|||
writeNamedWriteable(queryBuilder);
|
||||
}
|
||||
|
||||
/**
|
||||
* Write an optional {@link QueryBuilder} to the stream.
|
||||
*/
|
||||
public void writeOptionalQuery(@Nullable QueryBuilder<?> queryBuilder) throws IOException {
|
||||
if (queryBuilder == null) {
|
||||
writeBoolean(false);
|
||||
} else {
|
||||
writeBoolean(true);
|
||||
writeQuery(queryBuilder);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes a {@link ShapeBuilder} to the current stream
|
||||
*/
|
||||
|
|
|
@ -112,7 +112,7 @@ public class FieldSortBuilder extends SortBuilder<FieldSortBuilder> {
|
|||
@Override
|
||||
public void writeTo(StreamOutput out) throws IOException {
|
||||
out.writeString(fieldName);
|
||||
out.writeOptionalQuery(nestedFilter);
|
||||
out.writeOptionalNamedWriteable(nestedFilter);
|
||||
out.writeOptionalString(nestedPath);
|
||||
out.writeGenericValue(missing);
|
||||
out.writeOptionalWriteable(order);
|
||||
|
|
|
@ -173,7 +173,7 @@ public class GeoDistanceSortBuilder extends SortBuilder<GeoDistanceSortBuilder>
|
|||
unit.writeTo(out);
|
||||
order.writeTo(out);
|
||||
out.writeOptionalWriteable(sortMode);
|
||||
out.writeOptionalQuery(nestedFilter);
|
||||
out.writeOptionalNamedWriteable(nestedFilter);
|
||||
out.writeOptionalString(nestedPath);
|
||||
out.writeBoolean(coerce);
|
||||
out.writeBoolean(ignoreMalformed);
|
||||
|
|
|
@ -128,7 +128,7 @@ public class ScriptSortBuilder extends SortBuilder<ScriptSortBuilder> {
|
|||
order.writeTo(out);
|
||||
out.writeOptionalWriteable(sortMode);
|
||||
out.writeOptionalString(nestedPath);
|
||||
out.writeOptionalQuery(nestedFilter);
|
||||
out.writeOptionalNamedWriteable(nestedFilter);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue