Skip to content

Commit c87e3eb

Browse files
committed
chore: rename CollectionDescriptor::name -> CollectionDescriptor::collectionName
1 parent 7bcb97d commit c87e3eb

25 files changed

Lines changed: 44 additions & 46 deletions

src/main/java/io/weaviate/client6/v1/api/collections/WeaviateCollectionsClient.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ private <PropertiesT> CollectionHandle<PropertiesT> use(CollectionDescriptor<Pro
106106
*/
107107
public <PropertiesT extends Record> CollectionConfig create(Class<PropertiesT> cls) throws IOException {
108108
var collection = CollectionDescriptor.ofClass(cls);
109-
return create(CollectionConfig.of(collection.name(), collection.configFn()));
109+
return create(CollectionConfig.of(collection.collectionName(), collection.configFn()));
110110
}
111111

112112
/**
@@ -130,7 +130,7 @@ public <PropertiesT extends Record> CollectionConfig create(
130130
Function<CollectionConfig.Builder, ObjectBuilder<CollectionConfig>> fn) throws IOException {
131131
var collection = CollectionDescriptor.ofClass(cls);
132132
var configFn = ObjectBuilder.partial(fn, collection.configFn());
133-
return create(CollectionConfig.of(collection.name(), configFn));
133+
return create(CollectionConfig.of(collection.collectionName(), configFn));
134134
}
135135

136136
/**

src/main/java/io/weaviate/client6/v1/api/collections/WeaviateCollectionsClientAsync.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ private <PropertiesT> CollectionHandleAsync<PropertiesT> use(CollectionDescripto
100100
*/
101101
public <PropertiesT extends Record> CompletableFuture<CollectionConfig> create(Class<PropertiesT> cls) {
102102
var collection = CollectionDescriptor.ofClass(cls);
103-
return create(CollectionConfig.of(collection.name(), collection.configFn()));
103+
return create(CollectionConfig.of(collection.collectionName(), collection.configFn()));
104104
}
105105

106106
/**
@@ -117,7 +117,7 @@ public <PropertiesT extends Record> CompletableFuture<CollectionConfig> create(C
117117
Function<CollectionConfig.Builder, ObjectBuilder<CollectionConfig>> fn) {
118118
var collection = CollectionDescriptor.ofClass(cls);
119119
var configFn = ObjectBuilder.partial(fn, collection.configFn());
120-
return create(CollectionConfig.of(collection.name(), configFn));
120+
return create(CollectionConfig.of(collection.collectionName(), configFn));
121121
}
122122

123123
/**

src/main/java/io/weaviate/client6/v1/api/collections/aggregate/AggregateRequest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ static <T> Rpc<AggregateRequest, WeaviateProtoAggregate.AggregateRequest, Aggreg
2020
return Rpc.of(
2121
request -> {
2222
var message = WeaviateProtoAggregate.AggregateRequest.newBuilder();
23-
message.setCollection(collection.name());
23+
message.setCollection(collection.collectionName());
2424
request.aggregation.appendTo(message);
2525
if (request.groupBy != null) {
26-
request.groupBy.appendTo(message, collection.name());
26+
request.groupBy.appendTo(message, collection.collectionName());
2727
}
2828
if (defaults.tenant() != null) {
2929
message.setTenant(defaults.tenant());

src/main/java/io/weaviate/client6/v1/api/collections/config/GetShardsRequest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public static final Endpoint<Void, List<Shard>> endpoint(
2020
CollectionHandleDefaults defaults) {
2121
return SimpleEndpoint.noBody(
2222
request -> "GET",
23-
request -> "/schema/" + collection.name() + "/shards",
23+
request -> "/schema/" + collection.collectionName() + "/shards",
2424
request -> defaults.tenant() != null
2525
? Map.of("tenant", defaults.tenant())
2626
: Collections.emptyMap(),

src/main/java/io/weaviate/client6/v1/api/collections/config/WeaviateConfigClient.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@ public WeaviateConfigClient(WeaviateConfigClient c, CollectionHandleDefaults def
4343
}
4444

4545
public Optional<CollectionConfig> get() throws IOException {
46-
return collectionsClient.getConfig(collection.name());
46+
return collectionsClient.getConfig(collection.collectionName());
4747
}
4848

4949
public void addProperty(Property property) throws IOException {
50-
this.restTransport.performRequest(new AddPropertyRequest(collection.name(), property),
50+
this.restTransport.performRequest(new AddPropertyRequest(collection.collectionName(), property),
5151
AddPropertyRequest._ENDPOINT);
5252
}
5353

@@ -73,7 +73,7 @@ public List<Shard> updateShards(ShardStatus status, String... shards) throws IOE
7373
public List<Shard> updateShards(ShardStatus status, List<String> shards) throws IOException {
7474
for (var shard : shards) {
7575
this.restTransport.performRequest(
76-
new UpdateShardStatusRequest(collection.name(), shard, status),
76+
new UpdateShardStatusRequest(collection.collectionName(), shard, status),
7777
UpdateShardStatusRequest._ENDPOINT);
7878
}
7979
return getShards();

src/main/java/io/weaviate/client6/v1/api/collections/config/WeaviateConfigClientAsync.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@ public WeaviateConfigClientAsync(WeaviateConfigClientAsync c, CollectionHandleDe
4444
}
4545

4646
public CompletableFuture<Optional<CollectionConfig>> get() throws IOException {
47-
return collectionsClient.getConfig(collection.name());
47+
return collectionsClient.getConfig(collection.collectionName());
4848
}
4949

5050
public CompletableFuture<Void> addProperty(Property property) throws IOException {
51-
return this.restTransport.performRequestAsync(new AddPropertyRequest(collection.name(), property),
51+
return this.restTransport.performRequestAsync(new AddPropertyRequest(collection.collectionName(), property),
5252
AddPropertyRequest._ENDPOINT);
5353
}
5454

@@ -76,7 +76,7 @@ public CompletableFuture<List<Shard>> updateShards(ShardStatus status, String...
7676
public CompletableFuture<List<Shard>> updateShards(ShardStatus status, List<String> shards) throws IOException {
7777
var updates = shards.stream().map(
7878
shard -> this.restTransport.performRequestAsync(
79-
new UpdateShardStatusRequest(collection.name(), shard, status),
79+
new UpdateShardStatusRequest(collection.collectionName(), shard, status),
8080
UpdateShardStatusRequest._ENDPOINT))
8181
.toArray(CompletableFuture[]::new);
8282
return CompletableFuture.allOf(updates).thenCompose(__ -> getShards());

src/main/java/io/weaviate/client6/v1/api/collections/data/DeleteManyRequest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public static Rpc<DeleteManyRequest, WeaviateProtoBatchDelete.BatchDeleteRequest
2121
return Rpc.of(
2222
request -> {
2323
var message = WeaviateProtoBatchDelete.BatchDeleteRequest.newBuilder();
24-
message.setCollection(collection.name());
24+
message.setCollection(collection.collectionName());
2525

2626
if (request.verbose != null) {
2727
message.setVerbose(request.verbose);

src/main/java/io/weaviate/client6/v1/api/collections/data/DeleteObjectRequest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public static final Endpoint<DeleteObjectRequest, Void> endpoint(
1212
CollectionHandleDefaults defaults) {
1313
return SimpleEndpoint.sideEffect(
1414
request -> "DELETE",
15-
request -> "/objects/" + collection.name() + "/" + request.uuid,
15+
request -> "/objects/" + collection.collectionName() + "/" + request.uuid,
1616
request -> defaults.queryParameters());
1717
}
1818
}

src/main/java/io/weaviate/client6/v1/api/collections/data/InsertManyRequest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public static <T> void buildObject(WeaviateProtoBatch.BatchObject.Builder object
9494
WeaviateObject<T, Reference, ObjectMetadata> insert,
9595
CollectionDescriptor<T> collection,
9696
CollectionHandleDefaults defaults) {
97-
object.setCollection(collection.name());
97+
object.setCollection(collection.collectionName());
9898

9999
var metadata = insert.metadata();
100100
if (metadata != null) {

src/main/java/io/weaviate/client6/v1/api/collections/data/ReferenceAddRequest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ public static final Endpoint<ReferenceAddRequest, Void> endpoint(
1313
CollectionHandleDefaults defaults) {
1414
return SimpleEndpoint.sideEffect(
1515
request -> "POST",
16-
request -> "/objects/" + descriptor.name() + "/" + request.fromUuid + "/references/" + request.fromProperty,
16+
request -> "/objects/" + descriptor.collectionName() + "/" + request.fromUuid + "/references/"
17+
+ request.fromProperty,
1718
request -> defaults.queryParameters(),
1819
request -> JSON.serialize(request.reference));
1920

0 commit comments

Comments
 (0)