Interface ConfigResolver

  • All Known Implementing Classes:
    ProvidenceConfig
    Functional Interface:
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

    @FunctionalInterface
    public interface ConfigResolver
    A config resolver resolves config file into suppliers for the actual config. Note that if handling of changes to the config is required, that is done by adding listener to the given supplier, see ConfigSupplier.
    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      default <Message extends net.morimekta.providence.PMessage<Message,Field>,Field extends net.morimekta.providence.descriptor.PField>
      ConfigSupplier<Message,Field>
      resolveConfig​(java.io.File configFile)
      Resolve a config file without parent config like on config file includes.
      <Message extends net.morimekta.providence.PMessage<Message,Field>,Field extends net.morimekta.providence.descriptor.PField>
      ConfigSupplier<Message,Field>
      resolveConfig​(java.io.File configFile, ConfigSupplier<Message,Field> parentConfig)
      Resolve a config file like on config file includes.
    • Method Detail

      • resolveConfig

        @Nonnull
        <Message extends net.morimekta.providence.PMessage<Message,Field>,Field extends net.morimekta.providence.descriptor.PField> ConfigSupplier<Message,Field> resolveConfig​(@Nonnull
                                                                                                                                                                                java.io.File configFile,
                                                                                                                                                                                @Nullable
                                                                                                                                                                                ConfigSupplier<Message,Field> parentConfig)
                                                                                                                                                                         throws ProvidenceConfigException
        Resolve a config file like on config file includes.
        Type Parameters:
        Message - The message type.
        Field - The message field type.
        Parameters:
        configFile - The file to resolve.
        parentConfig - The parent config supplier if any.
        Returns:
        The resolved config.
        Throws:
        ProvidenceConfigException - If parsing of config failed.
      • resolveConfig

        @Nonnull
        default <Message extends net.morimekta.providence.PMessage<Message,Field>,Field extends net.morimekta.providence.descriptor.PField> ConfigSupplier<Message,Field> resolveConfig​(@Nonnull
                                                                                                                                                                                        java.io.File configFile)
                                                                                                                                                                                 throws ProvidenceConfigException
        Resolve a config file without parent config like on config file includes.
        Type Parameters:
        Message - The message type.
        Field - The message field type.
        Parameters:
        configFile - The file to resolve.
        Returns:
        The resolved config.
        Throws:
        ProvidenceConfigException - If parsing of config failed.