Class JsonLdQuadImpl

    • Constructor Detail

      • JsonLdQuadImpl

        JsonLdQuadImpl​(com.github.jsonldjava.core.RDFDataset.Quad quad,
                       java.lang.String blankNodePrefix)
    • Method Detail

      • equals

        public boolean equals​(java.lang.Object obj)
        Description copied from interface: Quad
        Check it this Quad is equal to another Quad.

        Two Quads are equal if and only if their Quad.getGraphName(), Quad.getSubject(), Quad.getPredicate() and Quad.getObject() are equal.

        Implementations MUST also override Quad.hashCode() so that two equal Quads produce the same hash code.

        Note that a Quad MUST NOT be equal to a Triple, even if this Quad's Quad.getGraphName() is Optional.empty(). To test triple-like equivalence, callers can use:

         Quad q1;
         Triple t2;
         q1.asTriple().equals(t2));
         
        Specified by:
        equals in interface Quad
        Overrides:
        equals in class java.lang.Object
        Parameters:
        obj - Another object
        Returns:
        true if other is a Quad and is equal to this
        See Also:
        Object.equals(Object)
      • hashCode

        public int hashCode()
        Description copied from interface: Quad
        Calculate a hash code for this Quad.

        The returned hash code MUST be equal to the result of Objects.hash(Object...) with the arguments Quad.getSubject(), Quad.getPredicate(), Quad.getObject(), Quad.getGraphName().

        This method MUST be implemented in conjunction with Quad.equals(Object) so that two equal Quads produce the same hash code.

        Specified by:
        hashCode in interface Quad
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        a hash code value for this Quad.
        See Also:
        Object.hashCode(), Objects.hash(Object...)