azure-docs-sdk-java/docs-ref-autogen/com.azure.messaging.eventhu...

317 строки
29 KiB
YAML

### YamlMime:JavaType
uid: "com.azure.messaging.eventhubs.EventData"
fullName: "com.azure.messaging.eventhubs.EventData"
name: "EventData"
nameWithType: "EventData"
summary: "The data structure encapsulating the event being sent-to and received-from Event Hubs."
inheritances:
- "<xref href=\"java.lang.Object?displayProperty=fullName\" data-throw-if-not-resolved=\"False\" />"
- "<xref href=\"com.azure.core.models.MessageContent?displayProperty=fullName\" data-throw-if-not-resolved=\"False\" />"
inheritedClassMethods:
- classRef: "<xref href=\"com.azure.core.models.MessageContent?alt=com.azure.core.models.MessageContent&text=MessageContent\" data-throw-if-not-resolved=\"False\" />"
methodsRef:
- "<xref href=\"com.azure.core.models.MessageContent.getBodyAsBinaryData()?alt=com.azure.core.models.MessageContent.getBodyAsBinaryData&text=getBodyAsBinaryData\" data-throw-if-not-resolved=\"False\" />"
- "<xref href=\"com.azure.core.models.MessageContent.getContentType()?alt=com.azure.core.models.MessageContent.getContentType&text=getContentType\" data-throw-if-not-resolved=\"False\" />"
- "<xref href=\"com.azure.core.models.MessageContent.setBodyAsBinaryData(com.azure.core.util.BinaryData)?alt=com.azure.core.models.MessageContent.setBodyAsBinaryData&text=setBodyAsBinaryData\" data-throw-if-not-resolved=\"False\" />"
- "<xref href=\"com.azure.core.models.MessageContent.setContentType(java.lang.String)?alt=com.azure.core.models.MessageContent.setContentType&text=setContentType\" data-throw-if-not-resolved=\"False\" />"
- classRef: "java.lang.<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html\">Object</a>"
methodsRef:
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone--\">clone</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-\">equals</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--\">finalize</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--\">getClass</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--\">hashCode</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--\">notify</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--\">notifyAll</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--\">toString</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--\">wait</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-\">wait</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-\">wait</a>"
syntax: "public class **EventData**</br> extends <xref href=\"com.azure.core.models.MessageContent?alt=com.azure.core.models.MessageContent&text=MessageContent\" data-throw-if-not-resolved=\"False\" />"
constructors:
- uid: "com.azure.messaging.eventhubs.EventData.EventData()"
fullName: "com.azure.messaging.eventhubs.EventData.EventData()"
name: "EventData()"
nameWithType: "EventData.EventData()"
summary: "Creates an event with an empty body."
syntax: "public EventData()"
desc: "Creates an event with an empty body."
- uid: "com.azure.messaging.eventhubs.EventData.EventData(byte[])"
fullName: "com.azure.messaging.eventhubs.EventData.EventData(byte[] body)"
name: "EventData(byte[] body)"
nameWithType: "EventData.EventData(byte[] body)"
summary: "Creates an event containing the `body`."
parameters:
- description: "The data to set for this event."
name: "body"
type: "<xref href=\"byte?alt=byte&text=byte\" data-throw-if-not-resolved=\"False\" />[]"
syntax: "public EventData(byte[] body)"
desc: "Creates an event containing the `body`."
- uid: "com.azure.messaging.eventhubs.EventData.EventData(com.azure.core.util.BinaryData)"
fullName: "com.azure.messaging.eventhubs.EventData.EventData(BinaryData body)"
name: "EventData(BinaryData body)"
nameWithType: "EventData.EventData(BinaryData body)"
summary: "Creates an event with the provided <xref uid=\"com.azure.core.util.BinaryData\" data-throw-if-not-resolved=\"false\" data-raw-source=\"BinaryData\"></xref> as payload."
parameters:
- description: "The <xref uid=\"com.azure.core.util.BinaryData\" data-throw-if-not-resolved=\"false\" data-raw-source=\"BinaryData\"></xref> payload for this event."
name: "body"
type: "<xref href=\"com.azure.core.util.BinaryData?alt=com.azure.core.util.BinaryData&text=BinaryData\" data-throw-if-not-resolved=\"False\" />"
syntax: "public EventData(BinaryData body)"
desc: "Creates an event with the provided <xref uid=\"com.azure.core.util.BinaryData\" data-throw-if-not-resolved=\"false\" data-raw-source=\"BinaryData\"></xref> as payload."
- uid: "com.azure.messaging.eventhubs.EventData.EventData(java.lang.String)"
fullName: "com.azure.messaging.eventhubs.EventData.EventData(String body)"
name: "EventData(String body)"
nameWithType: "EventData.EventData(String body)"
summary: "Creates an event by encoding the `body` using UTF-8 charset."
parameters:
- description: "The string that will be UTF-8 encoded to create an event."
name: "body"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
syntax: "public EventData(String body)"
desc: "Creates an event by encoding the `body` using UTF-8 charset."
- uid: "com.azure.messaging.eventhubs.EventData.EventData(java.nio.ByteBuffer)"
fullName: "com.azure.messaging.eventhubs.EventData.EventData(ByteBuffer body)"
name: "EventData(ByteBuffer body)"
nameWithType: "EventData.EventData(ByteBuffer body)"
summary: "Creates an event containing the `body`."
parameters:
- description: "The data to set for this event."
name: "body"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/nio/ByteBuffer.html\">ByteBuffer</a>"
syntax: "public EventData(ByteBuffer body)"
desc: "Creates an event containing the `body`."
methods:
- uid: "com.azure.messaging.eventhubs.EventData.addContext(java.lang.String,java.lang.Object)"
fullName: "com.azure.messaging.eventhubs.EventData.addContext(String key, Object value)"
name: "addContext(String key, Object value)"
nameWithType: "EventData.addContext(String key, Object value)"
summary: "Adds a new key value pair to the existing context on Event Data."
parameters:
- description: "The key for this context object"
name: "key"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "The value for this context object."
name: "value"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html\">Object</a>"
syntax: "public EventData addContext(String key, Object value)"
desc: "Adds a new key value pair to the existing context on Event Data."
returns:
description: "The updated <xref uid=\"com.azure.messaging.eventhubs.EventData\" data-throw-if-not-resolved=\"false\" data-raw-source=\"EventData\"></xref>."
type: "<xref href=\"com.azure.messaging.eventhubs.EventData?alt=com.azure.messaging.eventhubs.EventData&text=EventData\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.messaging.eventhubs.EventData.equals(java.lang.Object)"
fullName: "com.azure.messaging.eventhubs.EventData.equals(Object o)"
name: "equals(Object o)"
nameWithType: "EventData.equals(Object o)"
summary: "True if the object is an <xref uid=\"com.azure.messaging.eventhubs.EventData\" data-throw-if-not-resolved=\"false\" data-raw-source=\"EventData\"></xref> and the binary contents of <xref uid=\"com.azure.messaging.eventhubs.EventData.getBody()\" data-throw-if-not-resolved=\"false\" data-raw-source=\"#getBody()\"></xref> are equal."
overridden: "java.lang.Object.equals(java.lang.Object)"
parameters:
- name: "o"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html\">Object</a>"
syntax: "public boolean equals(Object o)"
desc: "True if the object is an <xref uid=\"com.azure.messaging.eventhubs.EventData\" data-throw-if-not-resolved=\"false\" data-raw-source=\"EventData\"></xref> and the binary contents of <xref uid=\"com.azure.messaging.eventhubs.EventData.getBody()\" data-throw-if-not-resolved=\"false\" data-raw-source=\"#getBody()\"></xref> are equal."
returns:
type: "<xref href=\"boolean?alt=boolean&text=boolean\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.messaging.eventhubs.EventData.getBody()"
fullName: "com.azure.messaging.eventhubs.EventData.getBody()"
name: "getBody()"
nameWithType: "EventData.getBody()"
summary: "Gets the actual payload/data wrapped by Event<wbr>Data."
syntax: "public byte[] getBody()"
desc: "Gets the actual payload/data wrapped by EventData.\n\nIf the means for deserializing the raw data is not apparent to consumers, a common technique is to make use of <xref uid=\"com.azure.messaging.eventhubs.EventData.getProperties()\" data-throw-if-not-resolved=\"false\" data-raw-source=\"#getProperties()\"></xref> when creating the event, to associate serialization hints as an aid to consumers who wish to deserialize the binary data."
returns:
description: "A byte array representing the data."
type: "<xref href=\"byte?alt=byte&text=byte\" data-throw-if-not-resolved=\"False\" />[]"
- uid: "com.azure.messaging.eventhubs.EventData.getBodyAsBinaryData()"
fullName: "com.azure.messaging.eventhubs.EventData.getBodyAsBinaryData()"
name: "getBodyAsBinaryData()"
nameWithType: "EventData.getBodyAsBinaryData()"
summary: "Returns the <xref uid=\"com.azure.core.util.BinaryData\" data-throw-if-not-resolved=\"false\" data-raw-source=\"BinaryData\"></xref> payload associated with this event."
overridden: "com.azure.core.models.MessageContent.getBodyAsBinaryData()"
syntax: "public BinaryData getBodyAsBinaryData()"
desc: "Returns the <xref uid=\"com.azure.core.util.BinaryData\" data-throw-if-not-resolved=\"false\" data-raw-source=\"BinaryData\"></xref> payload associated with this event."
returns:
description: "the <xref uid=\"com.azure.core.util.BinaryData\" data-throw-if-not-resolved=\"false\" data-raw-source=\"BinaryData\"></xref> payload associated with this event."
type: "<xref href=\"com.azure.core.util.BinaryData?alt=com.azure.core.util.BinaryData&text=BinaryData\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.messaging.eventhubs.EventData.getBodyAsString()"
fullName: "com.azure.messaging.eventhubs.EventData.getBodyAsString()"
name: "getBodyAsString()"
nameWithType: "EventData.getBodyAsString()"
summary: "Returns event data as UTF-8 decoded string."
syntax: "public String getBodyAsString()"
desc: "Returns event data as UTF-8 decoded string."
returns:
description: "UTF-8 decoded string representation of the event data."
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- uid: "com.azure.messaging.eventhubs.EventData.getContentType()"
fullName: "com.azure.messaging.eventhubs.EventData.getContentType()"
name: "getContentType()"
nameWithType: "EventData.getContentType()"
summary: "Gets the MIME type describing the data contained in the <xref uid=\"com.azure.messaging.eventhubs.EventData.getBody()\" data-throw-if-not-resolved=\"false\" data-raw-source=\"#getBody()\"></xref>, intended to allow consumers to make informed decisions for inspecting and processing the event."
overridden: "com.azure.core.models.MessageContent.getContentType()"
syntax: "public String getContentType()"
desc: "Gets the MIME type describing the data contained in the <xref uid=\"com.azure.messaging.eventhubs.EventData.getBody()\" data-throw-if-not-resolved=\"false\" data-raw-source=\"#getBody()\"></xref>, intended to allow consumers to make informed decisions for inspecting and processing the event."
returns:
description: "The content type."
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- uid: "com.azure.messaging.eventhubs.EventData.getCorrelationId()"
fullName: "com.azure.messaging.eventhubs.EventData.getCorrelationId()"
name: "getCorrelationId()"
nameWithType: "EventData.getCorrelationId()"
summary: "Gets an application-defined value that represents the context to use for correlation across one or more operations."
syntax: "public String getCorrelationId()"
desc: "Gets an application-defined value that represents the context to use for correlation across one or more operations. The identifier is a free-form value and may reflect a unique identity or a shared data element with significance to the application."
returns:
description: "The correlation id. <code>null</code> if there is none set."
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- uid: "com.azure.messaging.eventhubs.EventData.getEnqueuedTime()"
fullName: "com.azure.messaging.eventhubs.EventData.getEnqueuedTime()"
name: "getEnqueuedTime()"
nameWithType: "EventData.getEnqueuedTime()"
summary: "Gets the instant, in UTC, of when the event was enqueued in the Event Hub partition."
syntax: "public Instant getEnqueuedTime()"
desc: "Gets the instant, in UTC, of when the event was enqueued in the Event Hub partition. This is only present on a **received** <xref uid=\"com.azure.messaging.eventhubs.EventData\" data-throw-if-not-resolved=\"false\" data-raw-source=\"EventData\"></xref>."
returns:
description: "The instant, in UTC, this was enqueued in the Event Hub partition. <code>null</code> if the <xref uid=\"com.azure.messaging.eventhubs.EventData\" data-throw-if-not-resolved=\"false\" data-raw-source=\"EventData\"></xref>\n was not received from Event Hubs service."
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/time/Instant.html\">Instant</a>"
- uid: "com.azure.messaging.eventhubs.EventData.getMessageId()"
fullName: "com.azure.messaging.eventhubs.EventData.getMessageId()"
name: "getMessageId()"
nameWithType: "EventData.getMessageId()"
summary: "Gets an application-defined value that uniquely identifies the event."
syntax: "public String getMessageId()"
desc: "Gets an application-defined value that uniquely identifies the event. The identifier is a free-form value and can reflect a GUID or an identifier derived from the application context."
returns:
description: "The message id. <code>null</code> if there is none set."
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- uid: "com.azure.messaging.eventhubs.EventData.getOffset()"
fullName: "com.azure.messaging.eventhubs.EventData.getOffset()"
name: "getOffset()"
nameWithType: "EventData.getOffset()"
summary: "Gets the offset of the event when it was received from the associated Event Hub partition."
syntax: "public Long getOffset()"
desc: "Gets the offset of the event when it was received from the associated Event Hub partition. This is only present on a **received** <xref uid=\"com.azure.messaging.eventhubs.EventData\" data-throw-if-not-resolved=\"false\" data-raw-source=\"EventData\"></xref>."
returns:
description: "The offset within the Event Hub partition of the received event. <code>null</code> if the <xref uid=\"com.azure.messaging.eventhubs.EventData\" data-throw-if-not-resolved=\"false\" data-raw-source=\"EventData\"></xref>\n was not received from Event Hubs service."
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Long.html\">Long</a>"
- uid: "com.azure.messaging.eventhubs.EventData.getPartitionKey()"
fullName: "com.azure.messaging.eventhubs.EventData.getPartitionKey()"
name: "getPartitionKey()"
nameWithType: "EventData.getPartitionKey()"
summary: "Gets the partition hashing key if it was set when originally publishing the event."
syntax: "public String getPartitionKey()"
desc: "Gets the partition hashing key if it was set when originally publishing the event. If it exists, this value was used to compute a hash to select a partition to send the message to. This is only present on a **received** <xref uid=\"com.azure.messaging.eventhubs.EventData\" data-throw-if-not-resolved=\"false\" data-raw-source=\"EventData\"></xref>."
returns:
description: "A partition key for this Event Data. <code>null</code> if the <xref uid=\"com.azure.messaging.eventhubs.EventData\" data-throw-if-not-resolved=\"false\" data-raw-source=\"EventData\"></xref> was not received from Event\n Hubs service or there was no partition key set when the event was sent to the Event Hub."
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- uid: "com.azure.messaging.eventhubs.EventData.getProperties()"
fullName: "com.azure.messaging.eventhubs.EventData.getProperties()"
name: "getProperties()"
nameWithType: "EventData.getProperties()"
summary: "Gets the set of free-form event properties which may be used for passing metadata associated with the event with the event body during Event Hubs operations."
syntax: "public Map<String,Object> getProperties()"
desc: "Gets the set of free-form event properties which may be used for passing metadata associated with the event with the event body during Event Hubs operations. A common use-case for `properties()` is to associate serialization hints for the <xref uid=\"com.azure.messaging.eventhubs.EventData.getBody()\" data-throw-if-not-resolved=\"false\" data-raw-source=\"#getBody()\"></xref> as an aid to consumers who wish to deserialize the binary data.\n\n**Adding serialization hint using `getProperties()`**\n\nIn the sample, the type of telemetry is indicated by adding an application property with key \"eventType\".\n\n```java\nTelemetryEvent telemetry = new TelemetryEvent(\"temperature\", \"37\");\n byte[] serializedTelemetryData = telemetry.toString().getBytes(UTF_8);\n\n EventData eventData = new EventData(serializedTelemetryData);\n eventData.getProperties().put(\"eventType\", TelemetryEvent.class.getName());\n```\n\nThe following types are supported:\n\n * <xref uid=\"\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Character\"></xref>\n * [Date][]\n * <xref uid=\"\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Double\"></xref>\n * <xref uid=\"\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Float\"></xref>\n * <xref uid=\"java.lang.Integer\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Integer\"></xref>\n * <xref uid=\"java.lang.Long\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Long\"></xref>\n * <xref uid=\"\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Short\"></xref>\n * <xref uid=\"java.lang.String\" data-throw-if-not-resolved=\"false\" data-raw-source=\"String\"></xref>\n\n\n[Date]: https://docs.oracle.com/javase/8/docs/api/java/util/Date.html"
returns:
description: "Application properties associated with this <xref uid=\"com.azure.messaging.eventhubs.EventData\" data-throw-if-not-resolved=\"false\" data-raw-source=\"EventData\"></xref>. For received <xref uid=\"com.azure.messaging.eventhubs.EventData\" data-throw-if-not-resolved=\"false\" data-raw-source=\"EventData\"></xref>, the map is\n a read-only view."
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/util/Map.html\">Map</a>&lt;<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>,<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html\">Object</a>&gt;"
- uid: "com.azure.messaging.eventhubs.EventData.getRawAmqpMessage()"
fullName: "com.azure.messaging.eventhubs.EventData.getRawAmqpMessage()"
name: "getRawAmqpMessage()"
nameWithType: "EventData.getRawAmqpMessage()"
summary: "Gets the underlying AMQP message."
syntax: "public AmqpAnnotatedMessage getRawAmqpMessage()"
desc: "Gets the underlying AMQP message."
returns:
description: "The underlying AMQP message."
type: "<xref href=\"com.azure.core.amqp.models.AmqpAnnotatedMessage?alt=com.azure.core.amqp.models.AmqpAnnotatedMessage&text=AmqpAnnotatedMessage\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.messaging.eventhubs.EventData.getSequenceNumber()"
fullName: "com.azure.messaging.eventhubs.EventData.getSequenceNumber()"
name: "getSequenceNumber()"
nameWithType: "EventData.getSequenceNumber()"
summary: "Gets the sequence number assigned to the event when it was enqueued in the associated Event Hub partition."
syntax: "public Long getSequenceNumber()"
desc: "Gets the sequence number assigned to the event when it was enqueued in the associated Event Hub partition. This is unique for every message received in the Event Hub partition. This is only present on a **received** <xref uid=\"com.azure.messaging.eventhubs.EventData\" data-throw-if-not-resolved=\"false\" data-raw-source=\"EventData\"></xref>."
returns:
description: "The sequence number for this event. <code>null</code> if the <xref uid=\"com.azure.messaging.eventhubs.EventData\" data-throw-if-not-resolved=\"false\" data-raw-source=\"EventData\"></xref> was not received from Event\n Hubs service."
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Long.html\">Long</a>"
- uid: "com.azure.messaging.eventhubs.EventData.getSystemProperties()"
fullName: "com.azure.messaging.eventhubs.EventData.getSystemProperties()"
name: "getSystemProperties()"
nameWithType: "EventData.getSystemProperties()"
summary: "Properties that are populated by Event Hubs service."
syntax: "public Map<String,Object> getSystemProperties()"
desc: "Properties that are populated by Event Hubs service. As these are populated by the Event Hubs service, they are only present on a **received** <xref uid=\"com.azure.messaging.eventhubs.EventData\" data-throw-if-not-resolved=\"false\" data-raw-source=\"EventData\"></xref>. Provides an abstraction on top of properties exposed by <xref uid=\"com.azure.messaging.eventhubs.EventData.getRawAmqpMessage()\" data-throw-if-not-resolved=\"false\" data-raw-source=\"#getRawAmqpMessage()\"></xref>. These properties are read-only and can be modified via <xref uid=\"com.azure.messaging.eventhubs.EventData.getRawAmqpMessage()\" data-throw-if-not-resolved=\"false\" data-raw-source=\"#getRawAmqpMessage()\"></xref>."
returns:
description: "An encapsulation of all system properties appended by EventHubs service into <xref uid=\"com.azure.messaging.eventhubs.EventData\" data-throw-if-not-resolved=\"false\" data-raw-source=\"EventData\"></xref>. If the\n <xref uid=\"com.azure.messaging.eventhubs.EventData\" data-throw-if-not-resolved=\"false\" data-raw-source=\"EventData\"></xref> is not received from the Event Hubs service, the values returned are <code>null</code>."
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/util/Map.html\">Map</a>&lt;<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>,<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html\">Object</a>&gt;"
- uid: "com.azure.messaging.eventhubs.EventData.hashCode()"
fullName: "com.azure.messaging.eventhubs.EventData.hashCode()"
name: "hashCode()"
nameWithType: "EventData.hashCode()"
summary: "Gets a hash of the binary contents in <xref uid=\"com.azure.messaging.eventhubs.EventData.getBody()\" data-throw-if-not-resolved=\"false\" data-raw-source=\"#getBody()\"></xref>."
overridden: "java.lang.Object.hashCode()"
syntax: "public int hashCode()"
desc: "Gets a hash of the binary contents in <xref uid=\"com.azure.messaging.eventhubs.EventData.getBody()\" data-throw-if-not-resolved=\"false\" data-raw-source=\"#getBody()\"></xref>."
returns:
type: "<xref href=\"int?alt=int&text=int\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.messaging.eventhubs.EventData.setBodyAsBinaryData(com.azure.core.util.BinaryData)"
fullName: "com.azure.messaging.eventhubs.EventData.setBodyAsBinaryData(BinaryData binaryData)"
name: "setBodyAsBinaryData(BinaryData binaryData)"
nameWithType: "EventData.setBodyAsBinaryData(BinaryData binaryData)"
summary: "Sets a new binary body and corresponding <xref uid=\"com.azure.core.amqp.models.AmqpAnnotatedMessage\" data-throw-if-not-resolved=\"false\" data-raw-source=\"AmqpAnnotatedMessage\"></xref> on the event."
overridden: "com.azure.core.models.MessageContent.setBodyAsBinaryData(com.azure.core.util.BinaryData)"
parameters:
- name: "binaryData"
type: "<xref href=\"com.azure.core.util.BinaryData?alt=com.azure.core.util.BinaryData&text=BinaryData\" data-throw-if-not-resolved=\"False\" />"
syntax: "public EventData setBodyAsBinaryData(BinaryData binaryData)"
desc: "Sets a new binary body and corresponding <xref uid=\"com.azure.core.amqp.models.AmqpAnnotatedMessage\" data-throw-if-not-resolved=\"false\" data-raw-source=\"AmqpAnnotatedMessage\"></xref> on the event. Contents from <xref uid=\"com.azure.messaging.eventhubs.EventData.getRawAmqpMessage()\" data-throw-if-not-resolved=\"false\" data-raw-source=\"#getRawAmqpMessage()\"></xref> are shallow copied to the new underlying message."
returns:
type: "<xref href=\"com.azure.messaging.eventhubs.EventData?alt=com.azure.messaging.eventhubs.EventData&text=EventData\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.messaging.eventhubs.EventData.setContentType(java.lang.String)"
fullName: "com.azure.messaging.eventhubs.EventData.setContentType(String contentType)"
name: "setContentType(String contentType)"
nameWithType: "EventData.setContentType(String contentType)"
summary: "Sets the MIME type describing the data contained in the <xref uid=\"com.azure.messaging.eventhubs.EventData.getBody()\" data-throw-if-not-resolved=\"false\" data-raw-source=\"#getBody()\"></xref>, intended to allow consumers to make informed decisions for inspecting and processing the event."
overridden: "com.azure.core.models.MessageContent.setContentType(java.lang.String)"
parameters:
- description: "The content type."
name: "contentType"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
syntax: "public EventData setContentType(String contentType)"
desc: "Sets the MIME type describing the data contained in the <xref uid=\"com.azure.messaging.eventhubs.EventData.getBody()\" data-throw-if-not-resolved=\"false\" data-raw-source=\"#getBody()\"></xref>, intended to allow consumers to make informed decisions for inspecting and processing the event."
returns:
description: "The updated <xref uid=\"com.azure.messaging.eventhubs.EventData\" data-throw-if-not-resolved=\"false\" data-raw-source=\"EventData\"></xref>."
type: "<xref href=\"com.azure.messaging.eventhubs.EventData?alt=com.azure.messaging.eventhubs.EventData&text=EventData\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.messaging.eventhubs.EventData.setCorrelationId(java.lang.String)"
fullName: "com.azure.messaging.eventhubs.EventData.setCorrelationId(String correlationId)"
name: "setCorrelationId(String correlationId)"
nameWithType: "EventData.setCorrelationId(String correlationId)"
summary: "Sets an application-defined value that represents the context to use for correlation across one or more operations."
parameters:
- description: "The correlation id."
name: "correlationId"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
syntax: "public EventData setCorrelationId(String correlationId)"
desc: "Sets an application-defined value that represents the context to use for correlation across one or more operations. The identifier is a free-form value and may reflect a unique identity or a shared data element with significance to the application."
returns:
description: "The updated <xref uid=\"com.azure.messaging.eventhubs.EventData\" data-throw-if-not-resolved=\"false\" data-raw-source=\"EventData\"></xref>."
type: "<xref href=\"com.azure.messaging.eventhubs.EventData?alt=com.azure.messaging.eventhubs.EventData&text=EventData\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.messaging.eventhubs.EventData.setMessageId(java.lang.String)"
fullName: "com.azure.messaging.eventhubs.EventData.setMessageId(String messageId)"
name: "setMessageId(String messageId)"
nameWithType: "EventData.setMessageId(String messageId)"
summary: "Sets an application-defined value that uniquely identifies the event."
parameters:
- description: "The message id."
name: "messageId"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
syntax: "public EventData setMessageId(String messageId)"
desc: "Sets an application-defined value that uniquely identifies the event. The identifier is a free-form value and can reflect a GUID or an identifier derived from the application context."
returns:
description: "The updated <xref uid=\"com.azure.messaging.eventhubs.EventData\" data-throw-if-not-resolved=\"false\" data-raw-source=\"EventData\"></xref>."
type: "<xref href=\"com.azure.messaging.eventhubs.EventData?alt=com.azure.messaging.eventhubs.EventData&text=EventData\" data-throw-if-not-resolved=\"False\" />"
type: "class"
desc: "The data structure encapsulating the event being sent-to and received-from Event Hubs. Each Event Hub partition can be visualized as a stream of <xref uid=\"com.azure.messaging.eventhubs.EventData\" data-throw-if-not-resolved=\"false\" data-raw-source=\"EventData\"></xref>. This class is not thread-safe."
metadata: {}
package: "com.azure.messaging.eventhubs"
artifact: com.azure:azure-messaging-eventhubs:5.18.7