Class ReferenceConfigSupplier<RefMessage extends PMessage<RefMessage>,​ParentMessage extends PMessage<ParentMessage>>

  • All Implemented Interfaces:
    java.util.function.Supplier<RefMessage>, ConfigSupplier<RefMessage>

    public class ReferenceConfigSupplier<RefMessage extends PMessage<RefMessage>,​ParentMessage extends PMessage<ParentMessage>>
    extends UpdatingConfigSupplier<RefMessage>
    A supplier to get a config (aka message) from a resource location. This is a fixed static supplier, so listening to changes will never do anything.
         ConfigSupplier<Service, Service._Field> supplier =
                 new SerializedConfigSupplier<>(referencePath, Service.kDescriptor);
     
    • Constructor Detail

      • ReferenceConfigSupplier

        public ReferenceConfigSupplier​(ConfigSupplier<ParentMessage> parent,
                                       java.time.Clock clock,
                                       PField... fieldRefs)
                                throws ConfigException
        Create a config that wraps a providence message instance, and fetches a message from within that parent config. It is not allowed to have it return a null, meaning for the reference config to be valid, the reference must exist.
        Parameters:
        parent - The message type descriptor.
        clock - The clock to use for timing.
        fieldRefs - Fields to reference.
        Throws:
        ConfigException - If message overriding failed
    • Method Detail

      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.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.