Skip to content

Commit 54d36a8

Browse files
authored
update javaDoc (#581)
1 parent 1c7f1a2 commit 54d36a8

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

access-grant/src/main/java/com/inrupt/client/accessgrant/AccessGrantClient.java

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,13 @@
7272
7373
URI resource = URI.create("https://storage.example/data/resource");
7474
URI purpose = URI.create("https://purpose.example/1");
75-
client.query(resource, null, openid.getPrincipal().orElse(null), purpose, "Read", AccessGrant.class)
75+
AccessCredentialQuery<AccessGrant> query = AccessCredentialQuery.newBuilder()
76+
.resource(resource)
77+
.mode("Read")
78+
.purpose(purpose)
79+
.build(AccessGrant.class);
80+
81+
client.query(query)
7682
.thenApply(grants -> AccessGrantSession.ofAccessGrant(openid, grants.toArray(new AccessGrant[0])))
7783
.thenApply(session -> SolidClient.getClient().session(session))
7884
.thenAccept(cl -> {
@@ -376,7 +382,7 @@ public CompletionStage<AccessCredentialVerification> verify(final AccessCredenti
376382
}
377383

378384
/**
379-
* Perform an Access Grant query.
385+
* Perform an Access Credentials query and returns 0 to N matching access credentials.
380386
*
381387
* @param <T> the AccessCredential type
382388
* @param resource the resource identifier, may be {@code null}
@@ -397,7 +403,7 @@ public <T extends AccessCredential> CompletionStage<List<T>> query(final URI res
397403
}
398404

399405
/**
400-
* Perform an Access Grant query.
406+
* Perform an Access Credentials query and returns 0 to N matching access credentials.
401407
*
402408
* @param <T> the AccessCredential type
403409
* @param query the access credential query, never {@code null}
@@ -457,7 +463,7 @@ private <T extends AccessCredential> CompletionStage<List<T>> query(final URI re
457463
}
458464

459465
/**
460-
* Perform an Access Grant query.
466+
* Perform an Access Grant query and returns 0 to N matching Access Grants.
461467
*
462468
* <p>The {@code type} parameter must be an absolute URI. For Access Requests,
463469
* the URI is {@code http://www.w3.org/ns/solid/vc#SolidAccessRequest}. For Access Grants, the URI
@@ -559,7 +565,7 @@ public CompletionStage<Void> delete(final AccessCredential credential) {
559565
}
560566

561567
/**
562-
* Fetch an access credential.
568+
* Fetch an access credential by identifier. Return at most one access credential or throws an exception.
563569
*
564570
* @param identifier the access credential identifier
565571
* @return the next stage of completion, containing the access credential
@@ -571,7 +577,7 @@ public CompletionStage<AccessGrant> fetch(final URI identifier) {
571577
}
572578

573579
/**
574-
* Fetch an access credential.
580+
* Fetch an access credential by identifier. Return at most one access credential or throws an exception.
575581
*
576582
* @param <T> the credential type
577583
* @param identifier the access credential identifier

0 commit comments

Comments
 (0)