TSerializableId class abstract

Abstract base class providing serialization for objects with identifiers.

Extends TWriteableCustomId and adds convenience methods for converting the object into YAML, Markdown, and XML representations. This class provides a non-generic version that works with dynamic ID types.

For type-safe ID handling, use TSerializableCustomId in t_serializable_custom_id.dart.

Example:

class User extends TSerializableId {
  User({required this.name});

  final String name;

  @override
  String get id => 'user-123';

  @override
  Map<String, dynamic> toJson() => {'name': name};
}
Inheritance

Constructors

TSerializableId()

Properties

hashCode int
The hash code for this object.
no setterinherited
id → dynamic
The unique identifier for this document.
no setterinherited
markdownBuilder String Function(Map<String, dynamic> json)?
Returns a function that builds a Markdown string from a JSON map.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
xmlBuilder String Function(Map<String, dynamic> json)?
Returns a function that builds an XML string from a JSON map.
no setter
yamlBuilder String Function(Map<String, dynamic> json)?
Returns a function that builds a YAML string from a JSON map.
no setter

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
Converts the object to a Firestore-compatible map.
inherited
toMarkdown() String
Converts this object to a Markdown string.
toString() String
A string representation of this object.
inherited
toXml() String
Converts this object to an XML string.
toYaml() String
Converts this object to a YAML string.
validate<T>() → TurboResponse<T>?
Validates the object's data before writing to Firestore.
inherited

Operators

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