Class BoundPropertyResource

    • Constructor Detail

      • BoundPropertyResource

        protected BoundPropertyResource()
        Default constructor that allows the reference URI to be set later.
      • BoundPropertyResource

        protected BoundPropertyResource​(java.net.URI referenceURI)
        Constructs a resource with a reference URI.
        Parameters:
        referenceURI - The reference URI for the new resource.
    • Method Detail

      • getURI

        public java.net.URI getURI()
        Specified by:
        getURI in interface Resource
        Returns:
        The resource identifier URI, or null if the identifier is not known.
      • setReferenceURI

        public void setReferenceURI​(java.net.URI uri)
        Sets the reference URI of the resource.
        Parameters:
        uri - The new reference URI, or null if the identifier is not known.
      • equals

        public boolean equals​(java.lang.Object object)
        Compares the resource reference URIs. If neither object has a reference URI, the default identity comparison is performed.
        Overrides:
        equals in class java.lang.Object
        Parameters:
        object - The object with which to compare this resource.
        Returns:
        true if this resource equals that specified in object.
        See Also:
        getURI(), AbstractResource.equals(Object)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        A hashcode value composed from the reference URI, if available.
      • compareTo

        public int compareTo​(Resource resource)
        Compares this object to another object.

        This method determines order based upon the reference URI of the resource, if any; otherwise, the hash codes of the resources are compared. The resource with no URI is sorted before a resource with a URI. The same resource will always be considered equal.

        Specified by:
        compareTo in interface java.lang.Comparable<Resource>
        Parameters:
        resource - The resource with which to compare this resouce.
        Returns:
        A negative integer, zero, or a positive integer as this resource reference URI is less than, equal to, or greater than the reference URI of the specified resource, respectively.
        See Also:
        getURI(), hashCode(), DefaultResource.compareTo(Resource)
      • toString

        public java.lang.String toString()
        Returns a string representation of the resource. This version returns the URI, if there is one, between double angle quotation marks; otherwise the default string representation of the object is returned.
        Overrides:
        toString in class java.lang.Object
        Returns:
        A string representation of the resource.