Class AbstractObjectResource<C extends 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
  • Constructor Details

    • AbstractObjectResource

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

    • equals

      public boolean equals(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: