Skip to content

Commit c2552c2

Browse files
committed
JCL-340: Pluralize method names, where appropriate
1 parent 90710df commit c2552c2

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
@@ -33,7 +33,7 @@
3333
public class Metadata {
3434

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

6579
/**
@@ -258,7 +272,7 @@ public Builder contentType(final String type) {
258272
public Metadata build() {
259273
final Metadata metadata = new Metadata(builderStorage, builderContentType);
260274
metadata.wacAllow.putAll(builderWacAllow);
261-
metadata.type.addAll(builderType);
275+
metadata.types.addAll(builderType);
262276
metadata.allowedMethods.addAll(builderAllowedMethods);
263277
metadata.allowedPatchSyntaxes.addAll(builderAllowedPatchSyntaxes);
264278
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://storage.example/")),
8081
resource.getMetadata().getStorage());
8182
assertTrue(resource.getMetadata().getWacAllow().get("user")
@@ -114,6 +115,7 @@ void testCheckRootOfSolidRDFSource() throws IOException, InterruptedException {
114115
try (final SolidRDFSource resource = response.body()) {
115116
assertEquals(uri, resource.getIdentifier());
116117
assertTrue(resource.getMetadata().getType().contains(LDP.BasicContainer));
118+
assertTrue(resource.getMetadata().getTypes().contains(LDP.BasicContainer));
117119
assertEquals(Optional.of(uri), resource.getMetadata().getStorage());
118120
}
119121
}

0 commit comments

Comments
 (0)