Enum Class IngestEncoding

java.lang.Object
java.lang.Enum<IngestEncoding>
codes.grow.packages.betterstack.IngestEncoding
All Implemented Interfaces:
Serializable, Comparable<IngestEncoding>, Constable

public enum IngestEncoding extends Enum<IngestEncoding>
Body encodings accepted by POST / on a Better Stack source's ingesting host.
  • Enum Constant Details

    • JSON

      public static final IngestEncoding JSON
      One JSON array per request (application/json). Default.
    • NDJSON

      public static final IngestEncoding NDJSON
      One JSON object per line (application/x-ndjson).
    • MSGPACK

      public static final IngestEncoding MSGPACK
      One MessagePack array per request (application/msgpack); dt is a MessagePack timestamp extension (type -1).
  • Method Details

    • values

      public static IngestEncoding[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static IngestEncoding valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • wireValue

      public String wireValue()
      Returns the configuration value (json, ndjson or msgpack).
      Returns:
      the wire name
    • contentType

      public String contentType()
      Returns the Content-Type sent for this encoding.
      Returns:
      the media type
    • parse

      public static Optional<IngestEncoding> parse(String text)
      Parses a configuration value (case-insensitive, surrounding blanks ignored).
      Parameters:
      text - json, ndjson or msgpack
      Returns:
      the encoding, or empty when unknown