Codec<T extends Object> class
abstract
This defines the interface for a content codec of a particular type T
.
It is responsible for knowing how to encode the content T
.
And it is responsible for knowing how to decode the EncodedContent.
- Implementers
Constructors
- Codec()
Properties
- contentType → ContentTypeId
-
This identifies the flavor of content this codec can handle.
It advertises the ability to be responsible for the specified
ContentTypeId.authorityId/ContentTypeId.typeId.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
decode(
EncodedContent encoded) → Future< T> -
This is called to decode the content captured by
encoded
. -
encode(
T decoded) → Future< EncodedContent> - This is called to encode the content
-
fallback(
T content) → String? - This may provide text that can be displayed instead of the content. It can be used in contexts that do not support rendering a content type.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited