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>
-
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
-
-
Field Summary
-
Fields inherited from interface com.globalmentor.net.Resource
URI_PROPERTY_NAME
-
-
Constructor Summary
Constructors Constructor Description AbstractObjectResource(java.net.URI uri, java.lang.Class<? extends C> type)
URI constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object object)
This implementation compares the resource URIs.-
Methods inherited from class com.globalmentor.net.DefaultResource
compareTo, getURI, setURI
-
Methods inherited from class com.globalmentor.net.AbstractResource
hashCode, toString, toString, toString
-
-
-
-
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 classAbstractResource
- See Also:
DefaultResource.getURI()
-
-