JsonTrait class

Represents a dynamic JSON trait state payload that conforms to json_trait_schema.md.

This message is used for Category 2 (vendor Matter clusters) and Category 3 (non-Matter capabilities) traits across all wire and internal paths, and for Category 1 traits on external JSON-only wire paths (for example, Query with JSON_TRAIT_ONLY).

Constructors

JsonTrait({Map<String, Object?>? data, String? id})
JsonTrait.fromJson(Map json_)

Properties

data ↔ Map<String, Object?>?
Holds the trait attributes, which conform to the trait's registered JSON Schema.
getter/setter pair
hashCode → int
The hash code for this object.
no setterinherited
id ↔ String?
Identifies the trait by its canonical four-segment capability ID, capability...: * Standard or Google Matter (Category 1): capability.matter.standard. or capability.matter.google., for example capability.matter.standard.Thermostat.
getter/setter pair
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Map<String, dynamic>
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited