Class ConfigParser.Content.Builder

All Implemented Interfaces:
Builder<ConfigParser.Content.Builder,ConfigParser.Content>, Supplier<ConfigParser.Content>
Enclosing interface:
ConfigParser.Content

public static class ConfigParser.Content.Builder extends ConfigContent.Builder<ConfigParser.Content.Builder> implements Builder<ConfigParser.Content.Builder,ConfigParser.Content>
Fluent API builder for ConfigParser.Content.
  • Method Details

    • data

      Data of the config source as loaded from underlying storage.
      Parameters:
      data - to be parsed
      Returns:
      updated builder instance
    • mediaType

      public ConfigParser.Content.Builder mediaType(MediaType mediaType)
      Media type of the content if known by the config source. Media type is configured on content, as sometimes you need the actual file to exist to be able to "guess" its media type, and this is the place we are sure it exists.
      Parameters:
      mediaType - media type of the content as understood by the config source
      Returns:
      updated builder instance
    • mediaType

      public ConfigParser.Content.Builder mediaType(Optional<MediaType> mediaType)
      A shortcut method to invoke with result of MediaTypes.detectType(String) and similar methods. Only sets media type if the parameter is present.
      Parameters:
      mediaType - optional of media type
      Returns:
      updated builder instance
    • charset

      public ConfigParser.Content.Builder charset(Charset charset)
      Configure charset if known by the config source.
      Parameters:
      charset - charset to use if the content should be read using a reader
      Returns:
      updated builder instance
    • build

      public ConfigParser.Content build()
      Description copied from interface: Builder
      Build the instance from this builder.
      Specified by:
      build in interface Builder<ConfigParser.Content.Builder,ConfigParser.Content>
      Returns:
      instance of the built type