ContentSerdes class
Class providing serializing and deserializing capabilities.
Constructors
- ContentSerdes()
- Creates a new ContentSerdes object which supports JSON and CBOR based media types by default.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
-
offeredMediaTypes
→ List<
String> -
Returns a List of media types which are offered when a Thing is exposed.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
supportedMediaTypes
→ List<
String> -
Returns a List of basic supported media types.
no setter
Methods
-
addOfferedMediaType(
String mediaType) → void -
Parses a String-based
mediaType
and adds it to the set of offeredMediaTypes. -
assignCodec(
String codecMediaType, ContentCodec codec) → void -
Register a new
codec
for a basiccodecMediaType
. -
contentToValue(
Content content, DataSchema? dataSchema) → Future< DataSchemaValue< Object?> ?> - Converts a Content object to a typed Object.
-
isSupportedMediaType(
String mediaType) → bool -
Checks if a given
mediaType
is supported. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
removeOfferedMediaType(
String mediaType) → void -
Parses a String-based
mediaType
and removes it from the set of offeredMediaTypes. -
toString(
) → String -
A string representation of this object.
inherited
-
valueToContent(
DataSchemaValue< Object?> ? value, DataSchema? dataSchema, [String mediaType = defaultMediaType]) → Content -
Converts a
value
to a byte representation based on itsmediaType
.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited