Class EventDataImpl
- java.lang.Object
-
- com.microsoft.azure.eventhubs.impl.EventDataImpl
-
- All Implemented Interfaces:
EventData
,Serializable
,Comparable<EventData>
public final class EventDataImpl extends Object implements EventData
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.microsoft.azure.eventhubs.EventData
EventData.SystemProperties
-
-
Constructor Summary
Constructors Constructor Description EventDataImpl(byte[] data)
EventDataImpl(byte[] data, int offset, int length)
EventDataImpl(ByteBuffer buffer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(EventData other)
boolean
equals(Object o)
byte[]
getBytes()
Get Actual Payload/Data wrapped by EventData.Object
getObject()
Use this method only if, the sender could be sending messages using third-party AMQP libraries.Map<String,Object>
getProperties()
Application property bagEventData.SystemProperties
getSystemProperties()
SystemProperties that are populated by EventHubService.int
hashCode()
void
setSystemProperties(EventData.SystemProperties props)
-
-
-
Constructor Detail
-
EventDataImpl
public EventDataImpl(byte[] data)
-
EventDataImpl
public EventDataImpl(byte[] data, int offset, int length)
-
EventDataImpl
public EventDataImpl(ByteBuffer buffer)
-
-
Method Detail
-
getObject
public Object getObject()
Description copied from interface:EventData
Use this method only if, the sender could be sending messages using third-party AMQP libraries.If all the senders of EventHub use client libraries released and maintained by Microsoft Azure EventHubs, use
EventData.getBytes()
method.Get the value of AMQP messages' Body section on the received
EventData
.If the AMQP message Body is always guaranteed to have Data section, use
EventData.getBytes()
method.
-
getBytes
public byte[] getBytes()
Description copied from interface:EventData
Get Actual Payload/Data wrapped by EventData.- Specified by:
getBytes
in interfaceEventData
- Returns:
- byte[] of the actual data
null if the body of the message has other inter-operable AMQP messages, whose body does not represent byte[]. In that case use
EventData.getObject()
.
-
getProperties
public Map<String,Object> getProperties()
Description copied from interface:EventData
Application property bag- Specified by:
getProperties
in interfaceEventData
- Returns:
- returns Application properties
-
getSystemProperties
public EventData.SystemProperties getSystemProperties()
Description copied from interface:EventData
SystemProperties that are populated by EventHubService.As these are populated by Service, they are only present on a Received EventData.
Usage:
final String offset = eventData.getSystemProperties().getOffset();
- Specified by:
getSystemProperties
in interfaceEventData
- Returns:
- an encapsulation of all SystemProperties appended by EventHubs service into EventData.
null
if theEventData
is not received and is created by the public constructors. - See Also:
EventData.SystemProperties.getOffset()
,EventData.SystemProperties.getSequenceNumber()
,EventData.SystemProperties.getPartitionKey()
,EventData.SystemProperties.getEnqueuedTime()
-
setSystemProperties
public void setSystemProperties(EventData.SystemProperties props)
- Specified by:
setSystemProperties
in interfaceEventData
-
compareTo
public int compareTo(EventData other)
- Specified by:
compareTo
in interfaceComparable<EventData>
-
-