Skip to content
Permalink
Browse files
Cleanup for PMD warnings in -rdf-api
Merge commit 'refs/pull/50/head' of https://github.com/apache/commons-rdf

Contributed by @ajs6f
  • Loading branch information
stain committed Feb 13, 2018
2 parents 09ae545 + f998f5d commit eebb6ad6b73501fbdd8da0d34c2e3b6fc979d2bb
Showing 9 changed files with 42 additions and 42 deletions.
@@ -99,7 +99,7 @@ public interface BlankNode extends BlankNodeOrIRI {
* @see Object#equals(Object)
*/
@Override
public boolean equals(Object other);
boolean equals(Object other);

/**
* Calculate a hash code for this BlankNode.
@@ -115,6 +115,6 @@ public interface BlankNode extends BlankNodeOrIRI {
* @see Object#hashCode()
*/
@Override
public int hashCode();
int hashCode();

}
@@ -57,7 +57,7 @@ public interface IRI extends BlankNodeOrIRI {
* @see Object#equals(Object)
*/
@Override
public boolean equals(Object other);
boolean equals(Object other);

/**
* Calculate a hash code for this IRI.
@@ -73,5 +73,5 @@ public interface IRI extends BlankNodeOrIRI {
* @see Object#hashCode()
*/
@Override
public int hashCode();
int hashCode();
}
@@ -120,7 +120,7 @@ public interface Literal extends RDFTerm {
* @see Object#equals(Object)
*/
@Override
public boolean equals(Object other);
boolean equals(Object other);

/**
* Calculate a hash code for this Literal.
@@ -139,6 +139,6 @@ public interface Literal extends RDFTerm {
* @see Objects#hash(Object...)
*/
@Override
public int hashCode();
int hashCode();

}
@@ -217,7 +217,7 @@ public int hashCode() {
* @see Object#equals(Object)
*/
@Override
public boolean equals(Object other);
boolean equals(Object other);

/**
* Calculate a hash code for this Quad.
@@ -235,6 +235,6 @@ public int hashCode() {
* @see Objects#hash(Object...)
*/
@Override
public int hashCode();
int hashCode();

}
@@ -56,7 +56,7 @@ public interface RDF {
*
* @return A new, unique {@link BlankNode}
*/
public BlankNode createBlankNode();
BlankNode createBlankNode();

/**
* Create a blank node based on the given name.
@@ -81,7 +81,7 @@ public interface RDF {
* node in the context of this {@link RDF}.
* @return A BlankNode for the given name
*/
public BlankNode createBlankNode(String name);
BlankNode createBlankNode(String name);

/**
* Create a new graph.
@@ -91,7 +91,7 @@ public interface RDF {
*
* @return A new Graph
*/
public Graph createGraph();
Graph createGraph();

/**
* Create a new dataset.
@@ -101,7 +101,7 @@ public interface RDF {
*
* @return A new Dataset
*/
public Dataset createDataset();
Dataset createDataset();

/**
* Create an IRI from a (possibly escaped) String.
@@ -117,7 +117,7 @@ public interface RDF {
* If the provided string is not acceptable, e.g. does not
* conform to the RFC3987 syntax.
*/
public IRI createIRI(String iri) throws IllegalArgumentException;
IRI createIRI(String iri) throws IllegalArgumentException;

/**
* Create a simple literal.
@@ -138,7 +138,7 @@ public interface RDF {
* If the provided lexicalForm is not acceptable, e.g. because
* it is too large for an underlying storage.
*/
public Literal createLiteral(String lexicalForm) throws IllegalArgumentException;
Literal createLiteral(String lexicalForm) throws IllegalArgumentException;

/**
* Create a literal with the specified data type.
@@ -170,7 +170,7 @@ public interface RDF {
* If any of the provided arguments are not acceptable, e.g.
* because the provided dataType is not permitted.
*/
public Literal createLiteral(String lexicalForm, IRI dataType) throws IllegalArgumentException;
Literal createLiteral(String lexicalForm, IRI dataType) throws IllegalArgumentException;

/**
* Create a language-tagged literal.
@@ -204,7 +204,7 @@ public interface RDF {
* If the provided values are not acceptable, e.g. because the
* languageTag was syntactically invalid.
*/
public Literal createLiteral(String lexicalForm, String languageTag) throws IllegalArgumentException;
Literal createLiteral(String lexicalForm, String languageTag) throws IllegalArgumentException;

/**
* Create a triple.
@@ -226,7 +226,7 @@ public interface RDF {
* because a Literal has a lexicalForm that is too large for an
* underlying storage.
*/
public Triple createTriple(BlankNodeOrIRI subject, IRI predicate, RDFTerm object) throws IllegalArgumentException;
Triple createTriple(BlankNodeOrIRI subject, IRI predicate, RDFTerm object) throws IllegalArgumentException;

/**
* Create a quad.
@@ -252,7 +252,7 @@ public interface RDF {
* because a Literal has a lexicalForm that is too large for an
* underlying storage.
*/
public Quad createQuad(BlankNodeOrIRI graphName, BlankNodeOrIRI subject, IRI predicate, RDFTerm object)
Quad createQuad(BlankNodeOrIRI graphName, BlankNodeOrIRI subject, IRI predicate, RDFTerm object)
throws IllegalArgumentException;

}
@@ -45,7 +45,7 @@ public interface RDFSyntax {
* "https://www.w3.org/TR/json-ld/">https://www.w3.org/TR/json-ld/</a>
*
*/
public static RDFSyntax JSONLD = W3CRDFSyntax.JSONLD;
static RDFSyntax JSONLD = W3CRDFSyntax.JSONLD;

/**
* RDF 1.1 Turtle
@@ -54,23 +54,23 @@ public interface RDFSyntax {
* "https://www.w3.org/TR/turtle/">https://www.w3.org/TR/turtle/</a>
*
*/
public static RDFSyntax TURTLE = W3CRDFSyntax.TURTLE;
static RDFSyntax TURTLE = W3CRDFSyntax.TURTLE;

/**
* RDF 1.1 N-Quads
*
* @see <a href=
* "https://www.w3.org/TR/n-quads/">https://www.w3.org/TR/n-quads/</a>
*/
public static RDFSyntax NQUADS = W3CRDFSyntax.NQUADS;
static RDFSyntax NQUADS = W3CRDFSyntax.NQUADS;

/**
* RDF 1.1 N-Triples
*
* @see <a href=
* "https://www.w3.org/TR/n-triples/">https://www.w3.org/TR/n-triples/</a>
*/
public static RDFSyntax NTRIPLES = W3CRDFSyntax.NTRIPLES;
static RDFSyntax NTRIPLES = W3CRDFSyntax.NTRIPLES;

/**
* HTML+RDFa 1.1 and XHTML+RDFa 1.1
@@ -80,23 +80,23 @@ public interface RDFSyntax {
* @see <a href=
* "https://www.w3.org/TR/xhtml-rdfa/">https://www.w3.org/TR/xhtml-rdfa/</a>
*/
public static RDFSyntax RDFA = W3CRDFSyntax.RDFA;
static RDFSyntax RDFA = W3CRDFSyntax.RDFA;

/**
* RDF 1.1 XML Syntax
*
* @see <a href=
* "https://www.w3.org/TR/rdf-syntax-grammar/">https://www.w3.org/TR/rdf-syntax-grammar/</a>
*/
public static RDFSyntax RDFXML = W3CRDFSyntax.RDFXML;
static RDFSyntax RDFXML = W3CRDFSyntax.RDFXML;

/**
* RDF 1.1 TriG
*
* @see <a href=
* "https://www.w3.org/TR/trig/">https://www.w3.org/TR/trig/</a>
*/
public static RDFSyntax TRIG = W3CRDFSyntax.TRIG;
static RDFSyntax TRIG = W3CRDFSyntax.TRIG;

/**
* A short name of the RDF Syntax e.g. <code>JSONLD</code>.
@@ -105,7 +105,7 @@ public interface RDFSyntax {
*
* @return Short name for RDF syntax
*/
public String name();
String name();

/**
* The title of the RDF Syntax.
@@ -115,7 +115,7 @@ public interface RDFSyntax {
*
* @return Title of RDF Syntax
*/
public String title();
String title();

/**
* The <a href="https://tools.ietf.org/html/rfc2046">IANA media type</a> for
@@ -128,7 +128,7 @@ public interface RDFSyntax {
*
* @return The registered media type of the RDF Syntax
*/
public String mediaType();
String mediaType();

/**
* Set of <a href="https://tools.ietf.org/html/rfc2046">IANA media types</a> that
@@ -144,7 +144,7 @@ public interface RDFSyntax {
*
* @return The media types corresponding to the RDF Syntax
*/
default public Set<String> mediaTypes() {
default Set<String> mediaTypes() {
return Collections.singleton(mediaType());
}

@@ -156,7 +156,7 @@ default public Set<String> mediaTypes() {
*
* @return The registered file extension of the RDF Syntax
*/
public String fileExtension();
String fileExtension();

/**
* Set of file extensions for this RDF syntax, including any non-official extensions.
@@ -168,7 +168,7 @@ default public Set<String> mediaTypes() {
*
* @return The file extensions corresponding to the RDF Syntax
*/
default public Set<String> fileExtensions() {
default Set<String> fileExtensions() {
return Collections.singleton(fileExtension());
}

@@ -179,7 +179,7 @@ default public Set<String> fileExtensions() {
*
* @return true if this RDF Syntax supports datasets; false otherwise
*/
public boolean supportsDataset();
boolean supportsDataset();

/**
* Return the {@link IRI} that <em>identifies</em> the RDF syntax.
@@ -190,7 +190,7 @@ default public Set<String> fileExtensions() {
* @return Identifying IRI, e.g.
* <code>http://www.w3.org/ns/formats/JSON-LD</code>
*/
public IRI iri();
IRI iri();

/**
* Compare this RDFSyntax with another object.
@@ -237,7 +237,7 @@ default public Set<String> fileExtensions() {
* @see org.apache.commons.rdf.experimental.RDFParser
*/

public static Set<RDFSyntax> w3cSyntaxes() {
static Set<RDFSyntax> w3cSyntaxes() {
return W3CRDFSyntax.syntaxes;
}

@@ -261,7 +261,7 @@ public static Set<RDFSyntax> w3cSyntaxes() {
* {@link Optional#empty()} indicating that no matching syntax was
* found.
*/
public static Optional<RDFSyntax> byMediaType(final String mediaType) {
static Optional<RDFSyntax> byMediaType(final String mediaType) {
final String type = mediaType.toLowerCase(Locale.ROOT).split("\\s*;", 2)[0];
return w3cSyntaxes().stream().filter(t -> t.mediaTypes().contains(type))
.findAny();
@@ -283,7 +283,7 @@ public static Optional<RDFSyntax> byMediaType(final String mediaType) {
* {@link Optional#empty()} indicating that no matching file
* extension was found.
*/
public static Optional<RDFSyntax> byFileExtension(final String fileExtension) {
static Optional<RDFSyntax> byFileExtension(final String fileExtension) {
final String ext = fileExtension.toLowerCase(Locale.ROOT);
return w3cSyntaxes().stream().filter(t -> t.fileExtensions().contains(ext))
.findAny();
@@ -300,7 +300,7 @@ public static Optional<RDFSyntax> byFileExtension(final String fileExtension) {
* a matching {@link RDFSyntax#name()}, otherwise
* {@link Optional#empty()} indicating that no matching name was found.
*/
public static Optional<RDFSyntax> byName(final String name) {
static Optional<RDFSyntax> byName(final String name) {
return w3cSyntaxes().stream().filter(t -> t.name().equals(name)).findAny();
}

@@ -83,7 +83,7 @@ public interface RDFTerm {
* @return true if other is a RDFTerm and is equal to this
*/
@Override
public boolean equals(Object other);
boolean equals(Object other);

/**
* Calculate a hash code for this RDFTerm.
@@ -102,6 +102,6 @@ public interface RDFTerm {
* @return a hash code value for this RDFTerm.
*/
@Override
public int hashCode();
int hashCode();

}
@@ -106,7 +106,7 @@ public interface Triple extends TripleLike {
* @see Object#equals(Object)
*/
@Override
public boolean equals(Object other);
boolean equals(Object other);

/**
* Calculate a hash code for this Triple.
@@ -124,6 +124,6 @@ public interface Triple extends TripleLike {
* @see Objects#hash(Object...)
*/
@Override
public int hashCode();
int hashCode();

}
@@ -90,7 +90,7 @@ public interface RDFParser {
* This is a marker interface that may be subclassed to include parser
* details, e.g. warning messages or triple counts.
*/
public interface ParseResult {
interface ParseResult {
}

/**

0 comments on commit eebb6ad

Please sign in to comment.