01: /**
02: *
03: */package net.refractions.udig.core;
04:
05: /**
06: * An implementation of a Provider that provides the reference it was constructed with.
07: *
08: * <p>
09: * Example:
10: * </p><p>
11: * Provider<Integer> p=new StaticProvider<Integer>(integerInstance);
12: * </p>
13: *
14: * @author jones
15: * @since 1.1.0
16: */
17: public class StaticProvider<T> implements IProvider<T> {
18:
19: T object;
20:
21: public StaticProvider(T objectToProvide) {
22: this .object = objectToProvide;
23: }
24:
25: public T get() {
26: return object;
27: }
28:
29: }
|