org.openide.util.lookup

## Class AbstractLookup.Pair<T>

- java.lang.Object
- - org.openide.util.Lookup.Item<T>
  - - org.openide.util.lookup.AbstractLookup.Pair<T>

- All Implemented Interfaces:
    Serializable
  Enclosing class:
    AbstractLookup

      public abstract static class AbstractLookup.Pair<T>
      extends Lookup.Item<T>
      implements Serializable

  Extension to the default lookup item that offers additional information for the data structures use in AbstractLookup
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `Pair()` For use by subclasses.

  - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected abstract boolean` | `creatorOf(Object obj)` Method that can test whether an instance of a class has been created by this item.
    `protected abstract boolean` | `instanceOf(Class<?> c)` Tests whether this item can produce object of class c.

    - ### Methods inherited from class org.openide.util.Lookup.Item

      `getDisplayName, getId, getInstance, getType, toString`

    - ### Methods inherited from class java.lang.Object

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

- - ### Constructor Detail

    - #### Pair

          protected Pair()

      For use by subclasses.

  - ### Method Detail

    - #### instanceOf

          protected abstract boolean instanceOf(Class<?> c)

      Tests whether this item can produce object of class c.

      Typically this will produce the same result as `c.isAssignableFrom(``getType``())` but may avoid loading the concrete type's class in doing so.

    - #### creatorOf

          protected abstract boolean creatorOf(Object obj)

      Method that can test whether an instance of a class has been created by this item.
      Parameters:
        `obj` - the instance
      Returns:
        if the item has already create an instance and it is the same as obj.

Copyright © 2025 API Design. All Rights Reserved.