@Immutable public class FixedConfigSupplier<M extends PMessage<M,F>,F extends PField> extends Object implements ConfigSupplier<M,F>
| Constructor and Description |
|---|
FixedConfigSupplier(ConfigSupplier<M,F> supplier)
This essentially makes a static snapshot of the config and keeps the
config instance as a fixed (unmodifiable) config.
|
FixedConfigSupplier(M initialConfig)
Initialize with an initial config instance.
|
FixedConfigSupplier(M initialConfig,
long timestamp)
Initialize with an initial config instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addListener(ConfigListener<M,F> listener)
Add a listener to changes to this config.
|
long |
configTimestamp()
Get the last update time as a millisecond timestamp.
|
M |
get() |
String |
getName()
Get a simple descriptive name for this config supplier.
|
void |
removeListener(ConfigListener<M,F> listener)
Remove a config change listener.
|
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitsnapshotpublic FixedConfigSupplier(@Nonnull M initialConfig)
initialConfig - The initial config instance.public FixedConfigSupplier(@Nonnull ConfigSupplier<M,F> supplier)
supplier - The config supplier to copy.public final void addListener(@Nonnull ConfigListener<M,F> listener)
ConfigSupplieraddListener in interface ConfigSupplier<M extends PMessage<M,F>,F extends PField>listener - The config change listener to be added.public final void removeListener(@Nonnull ConfigListener<M,F> listener)
ConfigSupplierremoveListener in interface ConfigSupplier<M extends PMessage<M,F>,F extends PField>listener - The config change listener to be removed.public long configTimestamp()
ConfigSupplierconfigTimestamp in interface ConfigSupplier<M extends PMessage<M,F>,F extends PField>public String getName()
ConfigSupplierCopyright © 2015–2018 morimekta.net. All rights reserved.