Skip to content

Commit 5d0087e

Browse files
committed
fix circle
1 parent 1645b78 commit 5d0087e

File tree

1 file changed

+23
-5
lines changed
  • core/src/main/java/com/datastax/oss/driver/internal/core/type/codec

1 file changed

+23
-5
lines changed

core/src/main/java/com/datastax/oss/driver/internal/core/type/codec/VectorCodec.java

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public class VectorCodec<SubtypeT> implements TypeCodec<CqlVector<SubtypeT>> {
4040
private final GenericType<CqlVector<SubtypeT>> javaType;
4141
protected final TypeCodec<SubtypeT> subtypeCodec;
4242

43-
private final VectorCodec<SubtypeT> proxyCodec;
43+
private final VectorCodecProxy<SubtypeT> proxyCodec;
4444

4545
public VectorCodec(@NonNull VectorType cqlType, @NonNull TypeCodec<SubtypeT> subtypeCodec) {
4646
this.cqlType = cqlType;
@@ -69,6 +69,16 @@ public DataType getCqlType() {
6969
return this.cqlType;
7070
}
7171

72+
private interface VectorCodecProxy<SubtypeT> {
73+
@Nullable
74+
ByteBuffer encode(
75+
@Nullable CqlVector<SubtypeT> value, @NonNull ProtocolVersion protocolVersion);
76+
77+
@Nullable
78+
CqlVector<SubtypeT> decode(
79+
@Nullable ByteBuffer bytes, @NonNull ProtocolVersion protocolVersion);
80+
}
81+
7282
@Nullable
7383
@Override
7484
public ByteBuffer encode(
@@ -97,9 +107,13 @@ public CqlVector<SubtypeT> parse(@Nullable String value) {
97107
: CqlVector.from(value, this.subtypeCodec);
98108
}
99109

100-
private static class FixedLength<SubtypeT> extends VectorCodec<SubtypeT> {
110+
private static class FixedLength<SubtypeT> implements VectorCodecProxy<SubtypeT> {
111+
private final VectorType cqlType;
112+
private final TypeCodec<SubtypeT> subtypeCodec;
113+
101114
private FixedLength(VectorType cqlType, TypeCodec<SubtypeT> subtypeCodec) {
102-
super(cqlType, subtypeCodec);
115+
this.cqlType = cqlType;
116+
this.subtypeCodec = subtypeCodec;
103117
}
104118

105119
@Override
@@ -178,9 +192,13 @@ public CqlVector<SubtypeT> decode(
178192
}
179193
}
180194

181-
private static class VariableLength<SubtypeT> extends VectorCodec<SubtypeT> {
195+
private static class VariableLength<SubtypeT> implements VectorCodecProxy<SubtypeT> {
196+
private final VectorType cqlType;
197+
private final TypeCodec<SubtypeT> subtypeCodec;
198+
182199
private VariableLength(VectorType cqlType, TypeCodec<SubtypeT> subtypeCodec) {
183-
super(cqlType, subtypeCodec);
200+
this.cqlType = cqlType;
201+
this.subtypeCodec = subtypeCodec;
184202
}
185203

186204
@Override

0 commit comments

Comments
 (0)