Class ResourceConfig.BuilderBase<BUILDER extends ResourceConfig.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends ResourceConfig>

java.lang.Object
io.helidon.common.configurable.ResourceConfig.BuilderBase<BUILDER,PROTOTYPE>
Type Parameters:
BUILDER - type of the builder extending this abstract builder
PROTOTYPE - type of the prototype interface that would be built by Prototype.Builder.buildPrototype()
All Implemented Interfaces:
Prototype.Builder<BUILDER,PROTOTYPE>, Prototype.ConfiguredBuilder<BUILDER,PROTOTYPE>
Direct Known Subclasses:
ResourceConfig.Builder
Enclosing interface:
ResourceConfig

public abstract static class ResourceConfig.BuilderBase<BUILDER extends ResourceConfig.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends ResourceConfig> extends Object implements Prototype.ConfiguredBuilder<BUILDER,PROTOTYPE>
Fluent API builder base for Resource.
  • Constructor Details

    • BuilderBase

      protected BuilderBase()
      Protected to support extensibility.
  • Method Details

    • from

      public BUILDER from(ResourceConfig prototype)
      Update this builder from an existing prototype instance. This method disables automatic service discovery.
      Parameters:
      prototype - existing prototype to update this builder from
      Returns:
      updated builder instance
    • from

      public BUILDER from(ResourceConfig.BuilderBase<?,?> builder)
      Update this builder from an existing prototype builder instance.
      Parameters:
      builder - existing builder prototype to update this builder from
      Returns:
      updated builder instance
    • config

      public BUILDER config(Config config)
      Update builder from configuration (node of this type). If a value is present in configuration, it would override currently configured values.
      Specified by:
      config in interface Prototype.ConfiguredBuilder<BUILDER extends ResourceConfig.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends ResourceConfig>
      Parameters:
      config - configuration instance used to obtain values to update this builder
      Returns:
      updated builder instance
    • clearResourcePath

      public BUILDER clearResourcePath()
      Clear existing value of this property.
      Returns:
      updated builder instance
      See Also:
    • resourcePath

      public BUILDER resourcePath(String resourcePath)
      Resource is located on classpath.
      Parameters:
      resourcePath - classpath location of the resource
      Returns:
      updated builder instance
      See Also:
    • clearPath

      public BUILDER clearPath()
      Clear existing value of this property.
      Returns:
      updated builder instance
      See Also:
    • path

      public BUILDER path(Path path)
      Resource is located on filesystem.
      Parameters:
      path - path of the resource
      Returns:
      updated builder instance
      See Also:
    • clearContentPlain

      public BUILDER clearContentPlain()
      Clear existing value of this property.
      Returns:
      updated builder instance
      See Also:
    • contentPlain

      public BUILDER contentPlain(String contentPlain)
      Plain content of the resource (text).
      Parameters:
      contentPlain - plain content
      Returns:
      updated builder instance
      See Also:
    • clearContent

      public BUILDER clearContent()
      Clear existing value of this property.
      Returns:
      updated builder instance
      See Also:
    • content

      public BUILDER content(String content)
      Binary content of the resource (base64 encoded).
      Parameters:
      content - binary content
      Returns:
      updated builder instance
      See Also:
    • clearUri

      public BUILDER clearUri()
      Clear existing value of this property.
      Returns:
      updated builder instance
      See Also:
    • uri

      public BUILDER uri(URI uri)
      Resource is available on a URI.
      Parameters:
      uri - of the resource
      Returns:
      updated builder instance
      See Also:
    • clearProxy

      public BUILDER clearProxy()
      Clear existing value of this property.
      Returns:
      updated builder instance
      See Also:
    • proxy

      public BUILDER proxy(Proxy proxy)
      Proxy to use when using uri.
      Parameters:
      proxy - proxy
      Returns:
      updated builder instance
      See Also:
    • description

      public BUILDER description(String description)
      Description of this resource when configured through plain text or binary.
      Parameters:
      description - description
      Returns:
      updated builder instance
      See Also:
    • resourcePath

      public Optional<String> resourcePath()
      Resource is located on classpath.
      Returns:
      the resource path
    • path

      public Optional<Path> path()
      Resource is located on filesystem.
      Returns:
      the path
    • contentPlain

      public Optional<String> contentPlain()
      Plain content of the resource (text).
      Returns:
      the content plain
    • content

      public Optional<String> content()
      Binary content of the resource (base64 encoded).
      Returns:
      the content
    • uri

      public Optional<URI> uri()
      Resource is available on a URI.
      Returns:
      the uri
      See Also:
    • proxyHost

      public Optional<String> proxyHost()
      Host of the proxy when using URI.
      Returns:
      the proxy host
    • proxyPort

      public int proxyPort()
      Port of the proxy when using URI.
      Returns:
      the proxy port
    • useProxy

      public boolean useProxy()
      Whether to use proxy. If set to false, proxy will not be used even if configured. When set to true (default), proxy will be used if configured.
      Returns:
      the use proxy
    • proxy

      public Optional<Proxy> proxy()
      Proxy to use when using uri.
      Returns:
      the proxy
    • description

      public String description()
      Description of this resource when configured through plain text or binary.
      Returns:
      the description
    • config

      public Optional<Config> config()
      If this instance was configured, this would be the config instance used.
      Returns:
      config node used to configure this builder, or empty if not configured
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • preBuildPrototype

      protected void preBuildPrototype()
      Handles providers and decorators.
    • validatePrototype

      protected void validatePrototype()
      Validates required properties.