public abstract class UpdatingConfigSupplier<M extends PMessage<M,F>,F extends PField> extends Object implements ConfigSupplier<M,F>
supplier.set(config)) that will cause a config
change call to each listener regardless of if the config values actually
did change.| Modifier | Constructor and Description |
|---|---|
protected |
UpdatingConfigSupplier()
Initialize supplier with empty config.
|
protected |
UpdatingConfigSupplier(Clock clock)
Initialize supplier with empty config.
|
| 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() |
void |
removeListener(ConfigListener<M,F> listener)
Remove a config change listener.
|
protected void |
set(M config)
Set a new config value to the supplier.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetName, snapshotprotected UpdatingConfigSupplier()
protected UpdatingConfigSupplier(Clock clock)
public void addListener(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 void removeListener(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>protected final void set(M config)
config - The new config instance.Copyright © 2015–2017 morimekta.net. All rights reserved.