@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.
EventFormat| Enum Constant and Description |
|---|
AVRO_COMPACT
The content type for transports sending cloudevents in the compact Avro format.
|
JSON
Content type associated with the JSON event format
|
PROTO
The content type for transports sending cloudevents in the protocol buffer format.
|
XML
The content type for transports sending cloudevents in XML format.
|
| Modifier and Type | Method and Description |
|---|---|
String |
toString()
Return a string consisting of the slash-delimited (
/) two-part identifier for this enum constant. |
String |
value()
Return a string consisting of the slash-delimited (
/) two-part identifier for this enum constant. |
static ContentType |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static ContentType[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final ContentType JSON
public static final ContentType PROTO
public static final ContentType AVRO_COMPACT
public static final ContentType XML
public static ContentType[] values()
for (ContentType c : ContentType.values()) System.out.println(c);
public static ContentType valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic String value()
/) two-part identifier for this enum constant.public String toString()
/) two-part identifier for this enum constant.toString in class Enum<ContentType>Copyright © 2024. All rights reserved.