Class SinceInfoMapBuilder

java.lang.Object
io.aiven.commons.kafka.config.SinceInfoMapBuilder

public class SinceInfoMapBuilder extends Object
Class to build and maintain a list of Override ranges to final version. Items are retained in the order in which they were added.
  • Field Details

    • COMMENT_CHAR

      public static final String COMMENT_CHAR
      The comment character for comment lines in input files. The comment must be the first character in the line.
      See Also:
  • Constructor Details

    • SinceInfoMapBuilder

      public SinceInfoMapBuilder()
      Constructs a new SinceInfoMapBuilder.
  • Method Details

    • build

      Builds the final map.
      Returns:
      the override map.
    • put

      public void put(SinceInfo.OverrideRange range, SinceInfo.Data data)
      Put a range and data into the map.
      Parameters:
      range - the OverrideRange.
      data - the final version data.
    • put

      public void put(String groupId, String artifactId, String version, SinceInfo.Data data)
      put the range definition and the data into the map.
      Parameters:
      groupId - the group ID for the OverrideRange.
      artifactId - the artifact ID for the OverrideRange.
      version - the version for the OverrideRange.
      data - the final version data.
    • put

      public void put(String pattern, SinceInfo.Data data)
      Put an override pattern and the data into the map.
      Parameters:
      pattern - a pattern in the form groupId:artifactId:versionRange
      data - the final version data.
    • put

      public void put(SinceInfo.OverrideRange range, String finalVersion)
      Put an override range and final version into the map.
      Parameters:
      range - the override range.
      finalVersion - the final version.
    • put

      public void put(String groupId, String artifactId, String version, String finalVersion)
      Put the override range data and final version into the map.
      Parameters:
      groupId - the group ID for the OverrideRange.
      artifactId - the artifact ID for the OverrideRange.
      version - the version for the OverrideRange.
      finalVersion - the final version data.
    • put

      public void put(String pattern, String finalVersion)
      Put an override pattern and the final version into the map.
      Parameters:
      pattern - a pattern in the form groupId:artifactId:versionRange
      finalVersion - the final version data.
    • serialze

      public void serialze(PrintStream printStream)
      Serialize the map to a print stream.
      Parameters:
      printStream - the stream to serialize to.
    • parse

      public void parse(InputStream inputStream) throws IOException
      Read the map from an input stream. The stream must comprise lines of text in the form groupId:artifactId:versionRange:finalVersion Parser ignores empty lines and lines starting with '#'
      Parameters:
      inputStream - the input stream to read from.
      Throws:
      IOException - on input error or format error.
    • applyTo

      public void applyTo(org.apache.kafka.common.config.ConfigDef configDef)
      Applies the mapping to s the final versions for the specified Since values of the ExtendedConfigKeys in the ConfigDef.
      Parameters:
      configDef - the configDef to adjust.