Enum Class ContentType

java.lang.Object
java.lang.Enum<ContentType>
io.cloudevents.core.format.ContentType
All Implemented Interfaces:
Serializable, Comparable<ContentType>, Constable

@ParametersAreNonnullByDefault public enum ContentType extends Enum<ContentType>

A construct that aggregates a two-part identifier of file formats and format contents transmitted on the Internet.

The two parts of a ContentType are its type and a subtype; separated by a forward slash (/).

The constants enumerated by ContentType correspond only to the specialized formats supported by the Java™ SDK for CloudEvents.

See Also:
  • Nested Class Summary

    Nested classes/interfaces inherited from class java.lang.Enum

    Enum.EnumDesc<E extends Enum<E>>
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    The content type for transports sending cloudevents in the compact Avro format.
    Content type associated with the JSON event format
    The content type for transports sending cloudevents in the protocol buffer format.
    The content type for transports sending cloudevents in XML format.
  • Method Summary

    Modifier and Type
    Method
    Description
    Return a string consisting of the slash-delimited (/) two-part identifier for this enum constant.
    Return a string consisting of the slash-delimited (/) two-part identifier for this enum constant.
    Returns the enum constant of this class with the specified name.
    static ContentType[]
    Returns an array containing the constants of this enum class, in the order they are declared.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • JSON

      public static final ContentType JSON
      Content type associated with the JSON event format
    • PROTO

      public static final ContentType PROTO
      The content type for transports sending cloudevents in the protocol buffer format.
    • AVRO_COMPACT

      public static final ContentType AVRO_COMPACT
      The content type for transports sending cloudevents in the compact Avro format.
    • XML

      public static final ContentType XML
      The content type for transports sending cloudevents in XML format.
  • Method Details

    • values

      public static ContentType[] 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 ContentType 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
    • value

      public String value()
      Return a string consisting of the slash-delimited (/) two-part identifier for this enum constant.
    • toString

      public String toString()
      Return a string consisting of the slash-delimited (/) two-part identifier for this enum constant.
      Overrides:
      toString in class Enum<ContentType>