IntDecoder class

int 类型处理中间件 用法: @JsonKey(fromJson:IntDecoder.decodeOrNull) int? age;

Inheritance

Constructors

IntDecoder.new()

Properties

hashCode int
The hash code for this object.
no setterinherited
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
toString() String
A string representation of this object.
inherited

Operators

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

Static Methods

decodeOrDefault(dynamic value) int
策略2 异常情况解析默认值,比@JsonKey(defaultValue: 0)更健壮
decodeOrException(dynamic value) int
策略3 尝试解析异常情况报错并给出错误值
decodeOrNull(dynamic json) int?
策略1 异常情况解析为空