Table of Contents

Class CloudEvent<T>

Namespace
Savvyio.EventDriven.Messaging.CloudEvents
Assembly
Savvyio.EventDriven.Messaging.dll

Provides a default implementation of the ICloudEvent<T> interface.

public class CloudEvent<T> : CloudEvent, IEquatable<Acknowledgeable>, IEquatable<CloudEvent>, ICloudEvent<T>, IMessage<T>, IAcknowledgeable, IDictionary<string, object>, ICollection<KeyValuePair<string, object>>, IEnumerable<KeyValuePair<string, object>>, IEnumerable, IEquatable<CloudEvent<T>> where T : IIntegrationEvent

Type Parameters

T

The type of the payload constraint to the IIntegrationEvent interface.

Inheritance
Object
CloudEvent<T>
Implements
IEquatable<Acknowledgeable>
IEquatable<CloudEvent>
IDictionary<String, Object>
ICollection<KeyValuePair<String, Object>>
IEnumerable<KeyValuePair<String, Object>>
IEnumerable
IEquatable<CloudEvent<T>>
Derived
Inherited Members
Extension Methods

Constructors

CloudEvent(IMessage<T>, String)

Initializes a new instance of the CloudEvent<T> class.

public CloudEvent(IMessage<T> message, string specversion = null)

Parameters

message IMessage<T>

The message to elevate to an ICloudEvent<T> compliance.

specversion String

The version of the CloudEvents specification which the event uses.

Exceptions

System.ArgumentNullException

message cannot be null.

Properties

Data

Gets the event payload.

public T Data { get; }

Property Value

T

The event payload.

Remarks

Item[String]

Gets or sets the element with the specified key.

public object this[string key] { get; set; }

Parameters

key String

The key of the value to get or set.

Property Value

Object

The value associated with the specified key.

Methods

Add(String, Object)

Adds an element with the provided key and value to the CloudEvent.

public void Add(string key, object value)

Parameters

key String

The object to use as the key of the element to add.

value Object

The object to use as the value of the element to add.

Clear()

Removes all items from the CloudEvent.

public void Clear()

ContainsKey(String)

Determines whether the CloudEvent contains an element with the specified key.

public bool ContainsKey(string key)

Parameters

key String

The key to locate in the CloudEvent.

Returns

Boolean

true if the CloudEvent contains an element with the key; otherwise, false.

Remove(String)

Removes the element with the specified key from the CloudEvent.

public bool Remove(string key)

Parameters

key String

The key of the element to remove.

Returns

Boolean

true if the element is successfully removed; otherwise, false. This method also returns false if key was not found in the original CloudEvent.

TryGetValue(String, out Object)

Gets the value associated with the specified key.

public bool TryGetValue(string key, out object value)

Parameters

key String

The key whose value to get.

value Object

When this method returns, the value associated with the specified key, if the key is found; otherwise, the default value for the type of the value parameter. This parameter is passed uninitialized.

Returns

Boolean

true if the object that implements CloudEvent contains an element with the specified key; otherwise, false.

Explicit Interface Implementations

ICollection<KeyValuePair<String, Object>>.Add(KeyValuePair<String, Object>)

void ICollection<KeyValuePair<string, object>>.Add(KeyValuePair<string, object> item)

Parameters

item KeyValuePair<String, Object>

ICollection<KeyValuePair<String, Object>>.Contains(KeyValuePair<String, Object>)

bool ICollection<KeyValuePair<string, object>>.Contains(KeyValuePair<string, object> item)

Parameters

item KeyValuePair<String, Object>

Returns

Boolean

ICollection<KeyValuePair<String, Object>>.CopyTo(KeyValuePair<String, Object>[], Int32)

void ICollection<KeyValuePair<string, object>>.CopyTo(KeyValuePair<string, object>[] array, int arrayIndex)

Parameters

array KeyValuePair<String, Object>[]
arrayIndex Int32

ICollection<KeyValuePair<String, Object>>.Count

int ICollection<KeyValuePair<string, object>>.Count { get; }

Returns

Int32

ICollection<KeyValuePair<String, Object>>.IsReadOnly

bool ICollection<KeyValuePair<string, object>>.IsReadOnly { get; }

Returns

Boolean

ICollection<KeyValuePair<String, Object>>.Remove(KeyValuePair<String, Object>)

bool ICollection<KeyValuePair<string, object>>.Remove(KeyValuePair<string, object> item)

Parameters

item KeyValuePair<String, Object>

Returns

Boolean

IDictionary<String, Object>.Keys

ICollection<string> IDictionary<string, object>.Keys { get; }

Returns

ICollection<String>

IDictionary<String, Object>.Values

ICollection<object> IDictionary<string, object>.Values { get; }

Returns

ICollection<Object>

IEnumerable<KeyValuePair<String, Object>>.GetEnumerator()

IEnumerator<KeyValuePair<string, object>> IEnumerable<KeyValuePair<string, object>>.GetEnumerator()

Returns

IEnumerator<KeyValuePair<String, Object>>

IEnumerable.GetEnumerator()

IEnumerator IEnumerable.GetEnumerator()

Returns

IEnumerator

See Also