org.openide.util
Class Lookup.Template
java.lang.Object
|
+--org.openide.util.Lookup.Template
- Enclosing class:
- Lookup
- public static final class Lookup.Template
- extends Object
Template defining a pattern to filter instances by.
Lookup.Template
public Lookup.Template()
- General template to find all possible instances.
Lookup.Template
public Lookup.Template(Class type)
- Create a simple template matching by class.
- Parameters:
type
- the class of service we are looking for (subclasses will match)
Lookup.Template
public Lookup.Template(Class type,
String id,
Object instance)
- Constructor to create new template.
- Parameters:
type
- the class of service we are looking for or null
to leave unspecifiedid
- the ID of the item/service we are looking for or null
to leave unspecifiedinstance
- a specific known instance to look for or null
to leave unspecified
getType
public Class getType()
- Get the class (or superclass or interface) to search for.
If it was not specified in the constructor,
Object
is used as
this will match any instance.
- Returns:
- the class to search for
getId
public String getId()
- Get the persistent identifier being searched for, if any.
- Returns:
- the ID or
null
- Since:
- 1.8
- See Also:
Lookup.Item.getId()
getInstance
public Object getInstance()
- Get the specific instance being searched for, if any.
Most useful for finding an
Item
when the instance
is already known.
- Returns:
- the object to find or
null
- Since:
- 1.8
hashCode
public int hashCode()
- Overrides:
hashCode
in class Object
equals
public boolean equals(Object obj)
- Overrides:
equals
in class Object
toString
public String toString()
- Overrides:
toString
in class Object
Built on December 12 2001. | Portions Copyright 1997-2001 Sun Microsystems, Inc. All rights reserved.