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

java.lang.Object
io.helidon.http.media.gson.GsonSupportConfig.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.Builder
Enclosing interface:
GsonSupportConfig

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

    • BuilderBase

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

    • from

      public BUILDER from(GsonSupportConfig 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(GsonSupportConfig.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 GsonSupportConfig.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends GsonSupportConfig>
      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 GsonSupportConfig.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends GsonSupportConfig>
      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. Default value is gson.
      Parameters:
      name - name of the support
      Returns:
      updated builder instance
      See Also:
    • gson

      public BUILDER gson(com.google.gson.Gson gson)
      Gson instance.
      Parameters:
      gson - gson instance
      Returns:
      updated builder instance
      See Also:
    • properties

      public BUILDER properties(Map<String,Boolean> properties)
      Gson configuration properties. Properties are being ignored if specific Gson is set. Only boolean configuration values are supported. This method replaces all values with the new ones.
      Parameters:
      properties - gson config properties
      Returns:
      updated builder instance
      See Also:
    • addProperties

      public BUILDER addProperties(Map<String,Boolean> properties)
      Gson configuration properties. Properties are being ignored if specific Gson is set. Only boolean configuration values are supported. This method keeps existing values, then puts all new values into the map.
      Parameters:
      properties - gson config properties
      Returns:
      updated builder instance
      See Also:
    • putProperty

      public BUILDER putProperty(String key, Boolean property)
      Gson configuration properties. Properties are being ignored if specific Gson is set. Only boolean configuration values are supported. This method adds a new value to the map, or replaces it if the key already exists.
      Parameters:
      key - key to add or replace
      property - new value for the key
      Returns:
      updated builder instance
      See Also:
    • name

      public String name()
      Name of the support. Default value is gson.
      Returns:
      the name
    • gson

      public Optional<com.google.gson.Gson> gson()
      Gson instance.
      Returns:
      the gson
    • properties

      public Map<String,Boolean> properties()
      Gson configuration properties. Properties are being ignored if specific Gson is set. Only boolean configuration values are supported.
      Returns:
      the properties
    • 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.