# Class IdentifiedObjectFinder.Wrapper

Object
IdentifiedObjectFinder
Wrapper

Enclosing class:
  `IdentifiedObjectFinder`

public abstract static class IdentifiedObjectFinder.Wrapper extends IdentifiedObjectFinder
An object finder which delegates some or all work to another object finder. The default implementation of all `Wrapper` methods delegates the work to the object finder specified at construction time or in the last call to `delegate(IdentifiedObjectFinder)`. Subclasses can override methods for modifying some find operations.

Since:
  1.5

- ## Nested Class Summary

  ### Nested classes/interfaces inherited from class IdentifiedObjectFinder

  `IdentifiedObjectFinder​.Domain, IdentifiedObjectFinder​.Wrapper`

- ## Field Summary

  ### Fields inherited from class IdentifiedObjectFinder

  `factory`

- ## Constructor Summary

  Constructors
  Modifier
  Constructor
  Description
  `protected`
  `Wrapper(IdentifiedObjectFinder finder)`
  Creates a new object finder which will delegate the actual work to the given finder.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected IdentifiedObjectFinder`
  `delegate()`
  Returns the object finder to which to delegate the actual search operations.
  `protected void`
  `delegate(IdentifiedObjectFinder finder)`
  Sets a new finder to which to delegate the actual search operations.
  `Set<IdentifiedObject>`
  `find(IdentifiedObject object)`
  Looks up objects which are approximately equal to the specified object.
  `IdentifiedObject`
  `findSingleton(IdentifiedObject object)`
  Looks up only one object which is approximately equal to the specified object.
  `protected Iterable<String>`
  `getCodeCandidates(IdentifiedObject object)`
  Returns a set of authority codes that may identify the same object as the specified one.

  ### Methods inherited from class IdentifiedObjectFinder

  `getSearchDomain, isIgnoringAxes, setIgnoringAxes, setSearchDomain`

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### Wrapper

    protected Wrapper(IdentifiedObjectFinder finder)
    Creates a new object finder which will delegate the actual work to the given finder.
    Parameters:
      `finder` - the object finder to which to delegate the work.

- ## Method Details

  - ### delegate

    protected void delegate(IdentifiedObjectFinder finder) throws FactoryException
    Sets a new finder to which to delegate the actual search operations. If the specified finder is `this`, then this class will delegate to the default method implementations provided by the `IdentifiedObjectFinder` parent class. Otherwise, the specified finder should be a new instance not in use by other code.
    Parameters:
      `finder` - the object finder to which to delegate the work. Can be `this`.
    Throws:
      `FactoryException` - if the delegate cannot be set.

  - ### delegate

    protected IdentifiedObjectFinder delegate() throws FactoryException
    Returns the object finder to which to delegate the actual search operations. If this method returns `this`, then the search operations will be delegated to the default methods provided by the `IdentifiedObjectFinder` parent class.
    Returns:
      the object finder to which to delegate the work. May be `this`.
    Throws:
      `FactoryException` - if the delegate cannot be created.

  - ### find

    public Set<IdentifiedObject> find(IdentifiedObject object) throws FactoryException
    Looks up objects which are approximately equal to the specified object. The default method implementation delegates the work to the finder specified by `delegate()`.
    Overrides:
      `find` in class `IdentifiedObjectFinder`
    Parameters:
      `object` - the object looked up.
    Returns:
      the identified objects, or an empty set if not found.
    Throws:
      `FactoryException` - if an error occurred while fetching the authority code candidates.

  - ### findSingleton

    public IdentifiedObject findSingleton(IdentifiedObject object) throws FactoryException
    Looks up only one object which is approximately equal to the specified object. The default method implementation delegates the work to the finder specified by `delegate()`.
    Overrides:
      `findSingleton` in class `IdentifiedObjectFinder`
    Parameters:
      `object` - the object looked up.
    Returns:
      the identified object, or `null` if none or ambiguous.
    Throws:
      `FactoryException` - if an error occurred while fetching the authority code candidates.

  - ### getCodeCandidates

    protected Iterable<String> getCodeCandidates(IdentifiedObject object) throws FactoryException
    Returns a set of authority codes that may identify the same object as the specified one. The default method implementation delegates the work to the finder specified by `delegate()`.
    Overrides:
      `getCodeCandidates` in class `IdentifiedObjectFinder`
    Parameters:
      `object` - the object looked up.
    Returns:
      a set of code candidates.
    Throws:
      `FactoryException` - if an error occurred while fetching the set of code candidates.
    See Also:
      - `IdentifiedObject​.getIdentifiers()`
      - `AuthorityFactory​.getAuthorityCodes(Class)`