Adapt this Quad to a Triple.
The returned
Triple will have equivalent values returned from the
methods
TripleLike#getSubject(),
TripleLike#getPredicate() and
TripleLike#getObject().
The returned
Triple MUST NOT be
#equals(Object) to this
Quad, even if this quad has a default graph
#getGraphName() value of
Optional#empty(), but MUST
follow the
Triple#equals(Object) semantics. This means that the
following MUST be true:
Quad q1, q2;
if (q1.equals(q2)) {
assert (q1.asTriple().equals(q2.asTriple()));
} else if (q1.asTriple().equals(q2.asTriple())) {
assert (q1.getSubject().equals(q2.getSubject()));
assert (q1.getPredicate().equals(q2.getPredicate()));
assert (q1.getObject().equals(q2.getObject()));
assert (!q1.getGraphName().equals(q2.getGraphName()));
}
The
default
implementation of this method return a proxy
Triple instance that keeps a reference to this
Quad to
call the underlying
TripleLike methods, but supplies a
Triple compatible implementation of
Triple#equals(Object)and
Triple#hashCode(). Implementations may override this method,
e.g. for a more efficient solution.