Package com.globalmentor.net
Class AbstractObjectResource<C extends AbstractObjectResource<C>>
java.lang.Object
com.globalmentor.net.AbstractResource
com.globalmentor.net.DefaultResource
com.globalmentor.net.AbstractObjectResource<C>
- All Implemented Interfaces:
Resource
,Comparable<Resource>
public abstract class AbstractObjectResource<C extends AbstractObjectResource<C>>
extends DefaultResource
implements 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
-
Field Summary
Fields inherited from interface com.globalmentor.net.Resource
URI_PROPERTY_NAME
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class com.globalmentor.net.DefaultResource
compareTo, getURI, setURI
Methods inherited from class com.globalmentor.net.AbstractResource
hashCode, toString, toString, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Comparable
compareTo
-
Constructor Details
-
AbstractObjectResource
URI constructor.- Parameters:
uri
- The URI for the new resource.type
- The type of the new resource.
-
-
Method Details
-
equals
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 classAbstractResource
- See Also:
-