KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tc > config > schema > dynamic > FixedValueConfigItem


1 /*
2  * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
3  */

4 package com.tc.config.schema.dynamic;
5
6 /**
7  * A {@link ConfigItem} that always returns the same thing. Useful for tests.
8  */

9 public class FixedValueConfigItem implements ConfigItem {
10
11   private final Object JavaDoc value;
12
13   public FixedValueConfigItem(Object JavaDoc value) {
14     this.value = value;
15   }
16
17   public Object JavaDoc getObject() {
18     return this.value;
19   }
20
21   public void addListener(ConfigItemListener changeListener) {
22     // nothing here; this object never changes
23
}
24
25   public void removeListener(ConfigItemListener changeListener) {
26     // nothing here; this object never changes
27
}
28
29 }
30
Popular Tags