FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

JCL-340: Pluralize method names, where appropriate by acoburn · Pull Request #472 · inrupt/solid-client-java · GitHub

Repository navigation

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .java  (2) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public class Metadata {

private final URI acl;
private final URI storage;
private final Set<URI> type = new HashSet<>();
private final Set<URI> types = new HashSet<>();
private final Map<String, Set<String>> wacAllow = new HashMap<>();
private final Set<String> allowedMethods = new HashSet<>();
private final Set<String> allowedPatchSyntaxes = new HashSet<>();
Expand All @@ -58,9 +58,23 @@ public Optional<URI> getStorage() {
* {@code rdf:type} data explicitly set on a resource.
*
* @return the type values for a resource
* @deprecated as of Beta3, please use the {@link #getTypes} method
*/
@Deprecated
public Set<URI> getType() {
return type;
return getTypes();
}

/**
* The Solid Resource types.
*
* <p>This data typically comes from HTTP Link headers and may be different than
* {@code rdf:type} data explicitly set on a resource.
*
* @return the type values for a resource
*/
public Set<URI> getTypes() {
return types;
}

/**
Expand Down Expand Up @@ -294,7 +308,7 @@ public Builder contentType(final String type) {
public Metadata build() {
final Metadata metadata = new Metadata(builderStorage, builderAcl, builderContentType);
metadata.wacAllow.putAll(builderWacAllow);
metadata.type.addAll(builderType);
metadata.types.addAll(builderType);
metadata.allowedMethods.addAll(builderAllowedMethods);
metadata.allowedPatchSyntaxes.addAll(builderAllowedPatchSyntaxes);
metadata.allowedPostSyntaxes.addAll(builderAllowedPostSyntaxes);
Expand Down
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ void testGetOfSolidRDFSource() throws IOException, InterruptedException {
try (final SolidRDFSource resource = response.body()) {
assertEquals(uri, resource.getIdentifier());
assertTrue(resource.getMetadata().getType().contains(LDP.BasicContainer));
assertTrue(resource.getMetadata().getTypes().contains(LDP.BasicContainer));
assertEquals(Optional.of(URI.create("http://acl.example/solid/")),
resource.getMetadata().getAcl());
assertEquals(Optional.of(URI.create("http://storage.example/")),
Expand Down Expand Up @@ -116,6 +117,7 @@ void testCheckRootOfSolidRDFSource() throws IOException, InterruptedException {
try (final SolidRDFSource resource = response.body()) {
assertEquals(uri, resource.getIdentifier());
assertTrue(resource.getMetadata().getType().contains(LDP.BasicContainer));
assertTrue(resource.getMetadata().getTypes().contains(LDP.BasicContainer));
assertEquals(Optional.of(URI.create("http://acl.example/")),
resource.getMetadata().getAcl());
assertEquals(Optional.of(uri), resource.getMetadata().getStorage());
Expand Down

Back | FazBrowse Home | New Git URL