Class TestConfigSupplier<M extends net.morimekta.providence.PMessage<M,F>,F extends net.morimekta.providence.descriptor.PField>
- java.lang.Object
-
- net.morimekta.providence.config.impl.UpdatingConfigSupplier<M,F>
-
- net.morimekta.providence.config.util.TestConfigSupplier<M,F>
-
- Type Parameters:
M
- The message type.F
- The message field type.
- All Implemented Interfaces:
java.util.function.Supplier<M>
,ConfigSupplier<M,F>
public class TestConfigSupplier<M extends net.morimekta.providence.PMessage<M,F>,F extends net.morimekta.providence.descriptor.PField> extends UpdatingConfigSupplier<M,F>
Config supplier meant for testing only. It is an updating config supplier, but that exposes the config update method itself.
-
-
Constructor Summary
Constructors Constructor Description TestConfigSupplier(java.time.Clock clock, M initialConfig)
Start with an initial config value.TestConfigSupplier(M initialConfig)
Start with an initial config value.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getName()
Get a simple descriptive name for this config supplier.void
testUpdate(M newInstance)
Update the current config and trigger updates.java.lang.String
toString()
-
Methods inherited from interface net.morimekta.providence.config.ConfigSupplier
snapshot
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from class net.morimekta.providence.config.impl.UpdatingConfigSupplier
addListener, configTimestamp, get, removeListener, set
-
-
-
-
Constructor Detail
-
TestConfigSupplier
public TestConfigSupplier(@Nonnull M initialConfig)
Start with an initial config value.- Parameters:
initialConfig
- The initial config value.
-
TestConfigSupplier
public TestConfigSupplier(@Nonnull java.time.Clock clock, @Nonnull M initialConfig)
Start with an initial config value.- Parameters:
clock
- The clock to use for timing.initialConfig
- The initial config value.
-
-
Method Detail
-
testUpdate
public void testUpdate(@Nonnull M newInstance)
Update the current config and trigger updates.- Parameters:
newInstance
- The new config instance.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getName
public java.lang.String getName()
Description copied from interface:ConfigSupplier
Get a simple descriptive name for this config supplier.- Returns:
- The supplier name.
-
-