你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

CloudEventDataFormat Class

public final class CloudEventDataFormat
extends ExpandableStringEnum<CloudEventDataFormat>

Representation of the data format for a CloudEvent.

When constructing a CloudEvent this is passed to determine the serialized format of the event's data. If BYTES is used the data will be stored as a Base64 encoded string, otherwise it will be stored as a JSON serialized object.

Field Summary

Modifier and Type Field and Description
static final CloudEventDataFormat BYTES

Bytes format.

static final CloudEventDataFormat JSON

JSON format.

Constructor Summary

Constructor Description
CloudEventDataFormat()

Deprecated

Use one of the constants or the fromString(String name) factory method.

Creates a new instance of CloudEventDataFormat without a #toString() value.

Method Summary

Modifier and Type Method and Description
static CloudEventDataFormat fromString(String name)

Creates or gets a CloudEventDataFormat from its string representation.

Methods inherited from ExpandableStringEnum

Methods inherited from java.lang.Object

Field Details

BYTES

public static final CloudEventDataFormat BYTES

Bytes format.

JSON

public static final CloudEventDataFormat JSON

JSON format.

Constructor Details

CloudEventDataFormat

@Deprecated
public CloudEventDataFormat()

Deprecated

Use one of the constants or the fromString(String name) factory method.

Creates a new instance of CloudEventDataFormat without a #toString() value.

This constructor shouldn't be called as it will produce a CloudEventDataFormat which doesn't have a String enum value.

Method Details

fromString

public static CloudEventDataFormat fromString(String name)

Creates or gets a CloudEventDataFormat from its string representation.

Parameters:

name - Name of the CloudEventDataFormat.

Returns:

The corresponding CloudEventDataFormat.

Applies to