Replace (read|write)Shape with (read|write)NamedWriteable
This commit is contained in:
parent
d22603831d
commit
d1722c9908
|
@ -53,7 +53,7 @@ public class GeometryCollectionBuilder extends ShapeBuilder {
|
|||
public GeometryCollectionBuilder(StreamInput in) throws IOException {
|
||||
int shapes = in.readVInt();
|
||||
for (int i = 0; i < shapes; i++) {
|
||||
shape(in.readShape());
|
||||
shape(in.readNamedWriteable(ShapeBuilder.class));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -61,7 +61,7 @@ public class GeometryCollectionBuilder extends ShapeBuilder {
|
|||
public void writeTo(StreamOutput out) throws IOException {
|
||||
out.writeVInt(shapes.size());
|
||||
for (ShapeBuilder shape : shapes) {
|
||||
out.writeShape(shape);
|
||||
out.writeNamedWriteable(shape);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -746,13 +746,6 @@ public abstract class StreamInput extends InputStream {
|
|||
return readNamedWriteable(QueryBuilder.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads a {@link ShapeBuilder} from the current stream
|
||||
*/
|
||||
public ShapeBuilder readShape() throws IOException {
|
||||
return readNamedWriteable(ShapeBuilder.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads a {@link RescoreBuilder} from the current stream
|
||||
*/
|
||||
|
|
|
@ -711,13 +711,6 @@ public abstract class StreamOutput extends OutputStream {
|
|||
writeNamedWriteable(queryBuilder);
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes a {@link ShapeBuilder} to the current stream
|
||||
*/
|
||||
public void writeShape(ShapeBuilder shapeBuilder) throws IOException {
|
||||
writeNamedWriteable(shapeBuilder);
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes a {@link ScoreFunctionBuilder} to the current stream
|
||||
*/
|
||||
|
|
|
@ -144,7 +144,7 @@ public class GeoShapeQueryBuilder extends AbstractQueryBuilder<GeoShapeQueryBuil
|
|||
super(in);
|
||||
fieldName = in.readString();
|
||||
if (in.readBoolean()) {
|
||||
shape = in.readShape();
|
||||
shape = in.readNamedWriteable(ShapeBuilder.class);
|
||||
indexedShapeId = null;
|
||||
indexedShapeType = null;
|
||||
} else {
|
||||
|
@ -165,7 +165,7 @@ public class GeoShapeQueryBuilder extends AbstractQueryBuilder<GeoShapeQueryBuil
|
|||
boolean hasShape = shape != null;
|
||||
out.writeBoolean(hasShape);
|
||||
if (hasShape) {
|
||||
out.writeShape(shape);
|
||||
out.writeNamedWriteable(shape);
|
||||
} else {
|
||||
out.writeOptionalString(indexedShapeId);
|
||||
out.writeOptionalString(indexedShapeType);
|
||||
|
|
Loading…
Reference in New Issue