Map<String, Object?> encode() => { if (target != null) 'target': target!.toTfJson(), if (value != null) 'value': value!.toTfJson(), };