Skip to content

Commit a1199f7

Browse files
committed
JCL-340: Pluralize method names, where appropriate
1 parent f74fdce commit a1199f7

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

solid/src/main/java/com/inrupt/client/solid/Metadata.java

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public class Metadata {
3434

3535
private final URI acl;
3636
private final URI storage;
37-
private final Set<URI> type = new HashSet<>();
37+
private final Set<URI> types = new HashSet<>();
3838
private final Map<String, Set<String>> wacAllow = new HashMap<>();
3939
private final Set<String> allowedMethods = new HashSet<>();
4040
private final Set<String> allowedPatchSyntaxes = new HashSet<>();
@@ -58,9 +58,23 @@ public Optional<URI> getStorage() {
5858
* {@code rdf:type} data explicitly set on a resource.
5959
*
6060
* @return the type values for a resource
61+
* @deprecated as of Beta3, please use the {@link #getTypes} method
6162
*/
63+
@Deprecated
6264
public Set<URI> getType() {
63-
return type;
65+
return getTypes();
66+
}
67+
68+
/**
69+
* The Solid Resource types.
70+
*
71+
* <p>This data typically comes from HTTP Link headers and may be different than
72+
* {@code rdf:type} data explicitly set on a resource.
73+
*
74+
* @return the type values for a resource
75+
*/
76+
public Set<URI> getTypes() {
77+
return types;
6478
}
6579

6680
/**
@@ -294,7 +308,7 @@ public Builder contentType(final String type) {
294308
public Metadata build() {
295309
final Metadata metadata = new Metadata(builderStorage, builderAcl, builderContentType);
296310
metadata.wacAllow.putAll(builderWacAllow);
297-
metadata.type.addAll(builderType);
311+
metadata.types.addAll(builderType);
298312
metadata.allowedMethods.addAll(builderAllowedMethods);
299313
metadata.allowedPatchSyntaxes.addAll(builderAllowedPatchSyntaxes);
300314
metadata.allowedPostSyntaxes.addAll(builderAllowedPostSyntaxes);

solid/src/test/java/com/inrupt/client/solid/SolidRDFSourceTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ void testGetOfSolidRDFSource() throws IOException, InterruptedException {
7676
try (final SolidRDFSource resource = response.body()) {
7777
assertEquals(uri, resource.getIdentifier());
7878
assertTrue(resource.getMetadata().getType().contains(LDP.BasicContainer));
79+
assertTrue(resource.getMetadata().getTypes().contains(LDP.BasicContainer));
7980
assertEquals(Optional.of(URI.create("http://acl.example/solid/")),
8081
resource.getMetadata().getAcl());
8182
assertEquals(Optional.of(URI.create("http://storage.example/")),
@@ -116,6 +117,7 @@ void testCheckRootOfSolidRDFSource() throws IOException, InterruptedException {
116117
try (final SolidRDFSource resource = response.body()) {
117118
assertEquals(uri, resource.getIdentifier());
118119
assertTrue(resource.getMetadata().getType().contains(LDP.BasicContainer));
120+
assertTrue(resource.getMetadata().getTypes().contains(LDP.BasicContainer));
119121
assertEquals(Optional.of(URI.create("http://acl.example/")),
120122
resource.getMetadata().getAcl());
121123
assertEquals(Optional.of(uri), resource.getMetadata().getStorage());

0 commit comments

Comments
 (0)