MatterEventFactory

class MatterEventFactory<T : Event, A : Any> : InternalEventFactory


Defines the implementation APIs needed for creating events. Prevents leaking internal implementation of the events encoding.

Summary

Public constructors

<T : Event, A : Any> MatterEventFactory(
    scopedEventId: ScopedEventId,
    eventName: String,
    adapter: StructAdapter<A>,
    creator: (String, Long, EventImportance, ULong, A) -> T
)

Public functions

T
createEvent(
    eventTimestamp: Long,
    eventImportance: EventImportance,
    eventNumber: ULong,
    payload: TraitElementPayload
)

Creates an event.

open operator Boolean
equals(other: Any?)
open Int
open String

Public properties

StructAdapter<A>

the struct adapter to read/write event data

(String, Long, EventImportance, ULong, A) -> T

a lambda to create an instance of the Semantic Event

open String
String

The event name this factory builds.

ScopedEventId

The event id that this factory builds.

Public constructors

MatterEventFactory

<T : Event, A : Any> MatterEventFactory(
    scopedEventId: ScopedEventId,
    eventName: String,
    adapter: StructAdapter<A>,
    creator: (String, Long, EventImportance, ULong, A) -> T
)
Parameters
scopedEventId: ScopedEventId

The event id that this factory builds.

eventName: String

The event name this factory builds. Event names are static.

adapter: StructAdapter<A>

the struct adapter to read/write event data

creator: (String, Long, EventImportance, ULong, A) -> T

a lambda to create an instance of the Semantic Event

Public functions

createEvent

fun createEvent(
    eventTimestamp: Long,
    eventImportance: EventImportance,
    eventNumber: ULong,
    payload: TraitElementPayload
): T

Creates an event.

Parameters
eventTimestamp: Long

the timestamp the event was recorded at

eventImportance: EventImportance

the priority of the event as defined by the matter device

eventNumber: ULong

the number of the event reported by the matter device

payload: TraitElementPayload

the serialized event data

equals

open operator fun equals(other: Any?): Boolean

hashCode

open fun hashCode(): Int

toString

open fun toString(): String

Public properties

adapter

val adapter: StructAdapter<A>

the struct adapter to read/write event data

creator

val creator: (String, Long, EventImportance, ULong, A) -> T

a lambda to create an instance of the Semantic Event

eventId

open val eventId: String

eventName

val eventName: String

The event name this factory builds. Event names are static.

scopedEventId

val scopedEventId: ScopedEventId

The event id that this factory builds.