Class BatchSizeConfig

java.lang.Object
org.graylog2.outputs.BatchSizeConfig

public class BatchSizeConfig extends Object
This class represents the configuration of a batch size which is measured in bytes but also supports a count based configuration, e.g. number of messages, for backwards compatibility.
  • Method Details

    • parse

      public static BatchSizeConfig parse(String value)
      Create a config by parsing the supplied string as a Size, or an Integer for backwards compatibility.
    • forCount

      public static BatchSizeConfig forCount(int count)
      Create a count based config for backwards compatibility.
    • getAsBytes

      public Optional<com.github.joschi.jadconfig.util.Size> getAsBytes()
    • getAsCount

      public Optional<Integer> getAsCount()
    • jsonValue

      public Object jsonValue()
      Provides backwards compatibility for ExposedConfiguration. If the value is a number, keep serializing it as a number. Otherwise, just use the originally configured string.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object