Interface ConfigSupplier<M extends net.morimekta.providence.PMessage<M,F>,F extends net.morimekta.providence.descriptor.PField>

    • Method Detail

      • addListener

        void addListener​(@Nonnull
                         ConfigListener<M,F> listener)
        Add a listener to changes to this config. Note that this will store a weak reference to the listener instance, so the one adding the listener must make sure the listener is not GC'd.
        Parameters:
        listener - The config change listener to be added.
      • removeListener

        void removeListener​(@Nonnull
                            ConfigListener<M,F> listener)
        Remove a config change listener.
        Parameters:
        listener - The config change listener to be removed.
      • getName

        java.lang.String getName()
        Get a simple descriptive name for this config supplier.
        Returns:
        The supplier name.
      • configTimestamp

        long configTimestamp()
        Get the last update time as a millisecond timestamp.
        Returns:
        The timestamp of last update of the config.
      • snapshot

        default ConfigSupplier<M,F> snapshot()
        Get a snapshot of the current config.
        Returns:
        Non-modifiable supplier of current config containing a snapshot.