toJson<T> static method
T?
toJson<T>(
- Object? o, {
- JsonFieldMatcher? maskField,
- String maskText = '***',
- JsonFieldMatcher? removeField,
- bool removeNullFields = false,
- ToEncodableJsonProvider? toEncodableProvider,
- ToEncodable? toEncodable,
- EntityHandlerProvider? entityHandlerProvider,
- EntityCache? entityCache,
- bool? autoResetEntityCache,
Converts o
to a JSON collection/data.
maskField
when preset indicates if a field value should be masked withmaskText
.
Implementation
static T? toJson<T>(Object? o,
{JsonFieldMatcher? maskField,
String maskText = '***',
JsonFieldMatcher? removeField,
bool removeNullFields = false,
ToEncodableJsonProvider? toEncodableProvider,
ToEncodable? toEncodable,
EntityHandlerProvider? entityHandlerProvider,
EntityCache? entityCache,
bool? autoResetEntityCache}) {
var jsonCodec = _buildJsonEncoder(
maskField,
maskText,
removeField,
removeNullFields,
toEncodableProvider,
toEncodable,
entityHandlerProvider,
entityCache);
return jsonCodec.toJson(o, autoResetEntityCache: autoResetEntityCache);
}