Package hudson
Class Lookup
- java.lang.Object
-
- hudson.Lookup
-
public class Lookup extends Object
Type-safe instance map.- Author:
- Kohsuke Kawaguchi
-
-
Constructor Summary
Constructors Constructor Description Lookup()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> Tget(Class<T> type)<T> Tset(Class<T> type, T instance)<T> TsetIfNull(Class<T> type, T instance)Overwrites the value only if the current value is null.
-
-
-
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
instancevalue. Otherwise return the current value, which is non-null.
-
-