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

java.lang.Object
io.helidon.http.media.MediaSupportConfig.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>, ConfigBuilderSupport.ConfiguredBuilder<BUILDER,PROTOTYPE>, ConfigBuilderSupport.ConfiguredBuilder<BUILDER,PROTOTYPE>
Direct Known Subclasses:
GsonSupportConfig.BuilderBase, JacksonSupportConfig.BuilderBase, JsonBindingSupportConfig.BuilderBase, JsonbSupportConfig.BuilderBase, JsonpSupportConfig.BuilderBase, JsonSupportConfig.BuilderBase, MediaSupportConfig.Builder
Enclosing interface:
MediaSupportConfig

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

    • BuilderBase

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

    • from

      public BUILDER from(MediaSupportConfig 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(MediaSupportConfig.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

      @Deprecated 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 ConfigBuilderSupport.ConfiguredBuilder<BUILDER extends MediaSupportConfig.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends MediaSupportConfig>
      Parameters:
      config - configuration instance used to obtain values to update this builder
      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 ConfigBuilderSupport.ConfiguredBuilder<BUILDER extends MediaSupportConfig.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends MediaSupportConfig>
      Parameters:
      config - configuration instance used to obtain values to update this builder
      Returns:
      updated builder instance
    • name

      public BUILDER name(String name)
      Name of the support. Each extension should provide its own default. This is to enable multiple instance of the same type.
      Parameters:
      name - name of the support
      Returns:
      updated builder instance
      See Also:
    • clearAcceptedMediaTypes

      public BUILDER clearAcceptedMediaTypes()
      Clear all acceptedMediaTypes.
      Returns:
      updated builder instance
      See Also:
    • acceptedMediaTypes

      public BUILDER acceptedMediaTypes(Set<? extends MediaType> acceptedMediaTypes)
      Types accepted by this media support. When server processes the response, it checks the Accept header, to choose the right media support, if there are more supports available for the provided entity object.

      NOTE Make sure that you accept the type returned by contentType().

      Parameters:
      acceptedMediaTypes - accepted media types
      Returns:
      updated builder instance
      See Also:
    • addAcceptedMediaTypes

      public BUILDER addAcceptedMediaTypes(Set<? extends MediaType> acceptedMediaTypes)
      Types accepted by this media support. When server processes the response, it checks the Accept header, to choose the right media support, if there are more supports available for the provided entity object.

      NOTE Make sure that you accept the type returned by contentType().

      Parameters:
      acceptedMediaTypes - accepted media types
      Returns:
      updated builder instance
      See Also:
    • addAcceptedMediaType

      public BUILDER addAcceptedMediaType(MediaType acceptedMediaType)
      Types accepted by this media support. When server processes the response, it checks the Accept header, to choose the right media support, if there are more supports available for the provided entity object.

      NOTE Make sure that you accept the type returned by contentType().

      Parameters:
      acceptedMediaType - add single accepted media types
      Returns:
      updated builder instance
      See Also:
    • contentType

      public BUILDER contentType(HttpMediaType contentType)
      Content type to use if not configured (in response headers for server, and in request headers for client).
      Parameters:
      contentType - content type to use
      Returns:
      updated builder instance
      See Also:
    • contentType

      public BUILDER contentType(Consumer<HttpMediaType.Builder> consumer)
      Content type to use if not configured (in response headers for server, and in request headers for client).
      Parameters:
      consumer - consumer of builder of content type to use
      Returns:
      updated builder instance
      See Also:
    • contentType

      public BUILDER contentType(Supplier<? extends HttpMediaType> supplier)
      Content type to use if not configured (in response headers for server, and in request headers for client).
      Parameters:
      supplier - supplier of content type to use
      Returns:
      updated builder instance
      See Also:
    • name

      public Optional<String> name()
      Name of the support. Each extension should provide its own default. This is to enable multiple instance of the same type.
      Returns:
      name of the support
    • acceptedMediaTypes

      public Set<MediaType> acceptedMediaTypes()
      Types accepted by this media support. When server processes the response, it checks the Accept header, to choose the right media support, if there are more supports available for the provided entity object.

      NOTE Make sure that you accept the type returned by contentType().

      Returns:
      accepted media types
    • contentType

      public Optional<HttpMediaType> contentType()
      Content type to use if not configured (in response headers for server, and in request headers for client).
      Returns:
      content type to use
    • toString

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

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

      protected void validatePrototype()
      Validates required properties.
    • config

      protected Optional<Config> config()
      Configuration used to configure this instance.
      Returns:
      config instance