Serializers class abstract
Serializes all known classes.
See: https://github.com/google/built_value.dart/tree/master/example
Constructors
- Serializers()
-
Default Serializers that can serialize primitives and collections.
factory
Properties
-
builderFactories
→ BuiltMap<
FullType, Function> -
The installed builder factories.
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
-
serializerPlugins
→ Iterable<
SerializerPlugin> -
The installed serializer plugins.
no setter
-
serializers
→ Iterable<
Serializer> -
The installed Serializers.
no setter
Methods
-
deserialize(
Object? serialized, {FullType specifiedType = FullType.unspecified}) → Object? -
Deserializes
serialized
. -
deserializeWith<
T> (Serializer< T> serializer, Object? serialized) → T? -
Convenience method for when you know the type you're deserializing.
Specify the type by specifying its Serializer class. Equivalent to
calling deserialize with a
specifiedType
. -
expectBuilder(
FullType fullType) → void -
Throws if a builder for
fullType
is not available via newBuilder. -
fromJson<
T> (Serializer< T> serializer, String serialized) → T? -
Convenience method for when you have a JSON string and know the type
you're deserializing. Specify the type by specifying its Serializer
class. Equivalent to calling deserialize with a
specifiedType
then callingjson.decode
. -
hasBuilder(
FullType fullType) → bool -
Whether a builder for
fullType
is available via newBuilder. -
newBuilder(
FullType fullType) → Object -
Creates a new builder for the type represented by
fullType
. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
serialize(
Object? object, {FullType specifiedType = FullType.unspecified}) → Object? -
Serializes
object
. -
serializerForType(
Type type) → Serializer? -
Gets a serializer; returns
null
if none is found. For use in plugins and other extension code. -
serializerForWireName(
String wireName) → Serializer? -
Gets a serializer; returns
null
if none is found. For use in plugins and other extension code. -
serializeWith<
T> (Serializer< T> serializer, T? object) → Object? -
Convenience method for when you know the type you're serializing.
Specify the type by specifying its Serializer class. Equivalent to
calling serialize with a
specifiedType
. -
toBuilder(
) → SerializersBuilder -
toJson<
T> (Serializer< T> serializer, T? object) → String -
Convenience method for when you want a JSON string and know the type
you're serializing. Specify the type by specifying its Serializer
class. Equivalent to calling serialize with a
specifiedType
then callingjson.encode
. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
merge(
Iterable< Serializers> serializersIterable) → Serializers - Merges iterable of Serializers into a single Serializers.