Class AbstractObjectResource<C extends AbstractObjectResource<C>>

  • All Implemented Interfaces:
    Resource, java.lang.Comparable<Resource>

    public abstract class AbstractObjectResource<C extends AbstractObjectResource<C>>
    extends DefaultResource
    implements java.lang.Comparable<Resource>
    The abstract base class for a Java object that is also a resource.

    This implementation considers objects equal if they are of the the specified runtime type and have the same URI.

    Author:
    Garret Wilson
    • Constructor Detail

      • AbstractObjectResource

        public AbstractObjectResource​(java.net.URI uri,
                                      java.lang.Class<? extends C> type)
        URI constructor.
        Parameters:
        uri - The URI for the new resource.
        type - The type of the new resource.
    • Method Detail

      • equals

        public boolean equals​(java.lang.Object object)
        This implementation compares the resource URIs. If neither object has a reference URI, the default identity comparison is performed. This implementation compares the specified runtime type and resource URIs. If neither object has a reference URI, the default identity comparison is performed.
        Overrides:
        equals in class AbstractResource
        See Also:
        DefaultResource.getURI()