public class ProxyLookup extends Lookup
Lookup.Item<T>, Lookup.Provider, Lookup.Result<T>, Lookup.Template<T>| Modifier | Constructor and Description |
|---|---|
protected |
ProxyLookup()
Create a lookup initially proxying to no others.
|
|
ProxyLookup(Lookup... lookups)
Create a proxy to some other lookups.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
beforeLookup(Lookup.Template<?> template)
Notifies subclasses that a query is about to be processed.
|
protected Lookup[] |
getLookups()
Getter for the delegates.
|
<T> T |
lookup(Class<T> clazz)
Look up an object matching a given interface.
|
<T> Lookup.Result<T> |
lookup(Lookup.Template<T> template)
The general lookup method.
|
<T> Lookup.Item<T> |
lookupItem(Lookup.Template<T> template)
Look up the first item matching a given template.
|
protected void |
setLookups(Executor notifyIn,
Lookup... lookups)
Changes the delegates immediatelly, notifies the listeners in provided
executor, potentially later.
|
protected void |
setLookups(Lookup... lookups)
Changes the delegates.
|
String |
toString()
Returns a string representation of the object.
|
getDefault, lookupAll, lookupResultpublic ProxyLookup(Lookup... lookups)
lookups - the initial delegatesprotected ProxyLookup()
public String toString()
ObjecttoString method returns a string that
"textually represents" this object. The result should
be a concise but informative representation that is easy for a
person to read.
It is recommended that all subclasses override this method.
The toString method for class Object
returns a string consisting of the name of the class of which the
object is an instance, the at-sign character `@', and
the unsigned hexadecimal representation of the hash code of the
object. In other words, this method returns a string equal to the
value of:
getClass().getName() + '@' + Integer.toHexString(hashCode())
protected final Lookup[] getLookups()
protected final void setLookups(Lookup... lookups)
lookups - the new lookups to delegate toprotected final void setLookups(Executor notifyIn, Lookup... lookups)
lookups - the new lookups to delegate tonotifyIn - executor to deliver the notification to listeners or nullprotected void beforeLookup(Lookup.Template<?> template)
setLookups method
to change/update the set of objects the proxy delegates to.template - the template of the querypublic final <T> T lookup(Class<T> clazz)
Lookuppublic final <T> Lookup.Item<T> lookupItem(Lookup.Template<T> template)
LookuplookupItem in class Lookuptemplate - the template to checknullpublic final <T> Lookup.Result<T> lookup(Lookup.Template<T> template)
Lookuptemplate, request more info about
them in form of Lookup.Item and attach a listener to
this be notified about changes. The general interface does not
specify whether subsequent calls with the same template produce new
instance of the Lookup.Result or return shared instance. The
prefered behaviour however is to return shared one.Copyright © 2025 API Design. All Rights Reserved.