GossipMessage class
Gossip message structure
Constructors
-
GossipMessage({required String messageId, required String sourceNodeId, required dynamic payload, required DateTime timestamp, required int ttl, required GossipMessageType type, Map<
String, dynamic> metadata = const {}}) -
const
-
GossipMessage.fromJson(Map<
String, dynamic> json) -
Creates message from JSON
factory
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- isExpired → bool
-
Checks if message has expired
no setter
- messageId → String
-
final
-
metadata
→ Map<
String, dynamic> -
final
- payload → dynamic
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- sourceNodeId → String
-
final
- timestamp → DateTime
-
final
- ttl → int
-
final
- type → GossipMessageType
-
final
Methods
-
copyWithDecrementedTtl(
) → GossipMessage - Creates a copy with updated TTL
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> - Serializes message to JSON
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited