hudson
Class Lookup

java.lang.Object
  extended by hudson.Lookup

public class Lookup
extends Object

Type-safe instance map.

Author:
Kohsuke Kawaguchi

Constructor Summary
Lookup()
           
 
Method Summary
<T> T
get(Class<T> type)
           
<T> T
set(Class<T> type, T instance)
           
<T> T
setIfNull(Class<T> type, T instance)
          Overwrites the value only if the current value is null.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Lookup

public Lookup()
Method Detail

get

public <T> T get(Class<T> type)

set

public <T> T set(Class<T> type,
                 T instance)

setIfNull

public <T> T setIfNull(Class<T> type,
                       T instance)
Overwrites the value only if the current value is null.

Returns:
If the value was null, return the instance value. Otherwise return the current value, which is non-null.


Copyright © 2004-2013. All Rights Reserved.