Class GenericStatement<R extends Resource,​I extends IRI,​V extends Value>

    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected GenericStatement​(R subject, I predicate, V object, R context)
      Creates a new Statement with the supplied subject, predicate and object for the specified associated context.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object o)
      Compares this statement to another object.
      R getContext()
      Gets the context of this statement.
      V getObject()
      Gets the object of this statement.
      I getPredicate()
      Gets the predicate of this statement.
      R getSubject()
      Gets the subject of this statement.
      int hashCode()
      Computes the hash code of this statement.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • subject

        protected final R extends Resource subject
      • predicate

        protected final I extends IRI predicate
      • object

        protected final V extends Value object
      • context

        protected final R extends Resource context
    • Constructor Detail

      • GenericStatement

        protected GenericStatement​(R subject,
                                   I predicate,
                                   V object,
                                   R context)
        Creates a new Statement with the supplied subject, predicate and object for the specified associated context.

        Note that creating an objects directly via this constructor is not the recommended approach. Instead, use a ValueFactory (obtained from your repository or by using SimpleValueFactory.getInstance()) to create new Statement objects.

        Parameters:
        subject - The statement's subject, must not be null.
        predicate - The statement's predicate, must not be null.
        object - The statement's object, must not be null.
        context - The statement's context, null to indicate no context is associated.
    • Method Detail

      • getSubject

        public R getSubject()
        Description copied from interface: Statement
        Gets the subject of this statement.
        Specified by:
        getSubject in interface Statement
        Returns:
        The statement's subject.
      • getPredicate

        public I getPredicate()
        Description copied from interface: Statement
        Gets the predicate of this statement.
        Specified by:
        getPredicate in interface Statement
        Returns:
        The statement's predicate.
      • getObject

        public V getObject()
        Description copied from interface: Statement
        Gets the object of this statement.
        Specified by:
        getObject in interface Statement
        Returns:
        The statement's object.
      • getContext

        public R getContext()
        Description copied from interface: Statement
        Gets the context of this statement.
        Specified by:
        getContext in interface Statement
        Returns:
        The statement's context, or null in case of the null context or if not applicable.
      • equals

        public boolean equals​(java.lang.Object o)
        Description copied from interface: Statement
        Compares this statement to another object.
        Specified by:
        equals in interface Statement
        Overrides:
        equals in class java.lang.Object
        Parameters:
        o - the object to compare this statement to
        Returns:
        true if the other object is an instance of Statement and if their subjects, predicates, objects and contexts are equal; false otherwise
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object