Serialize constructor

const Serialize({
  1. bool input = true,
  2. bool output = true,
})

Annotates a ManagedObject property so it can be serialized.

A ManagedObject property declaration with this metadata will have its value encoded/decoded when converting the managed object to and from a Map.

If input is true, this property's value is set when converting from a map.

If output is true, this property is in the map created by ManagedObject.asMap. This key is only included if the value is non-null.

Both input and output default to true.

Implementation

const Serialize({bool input = true, bool output = true})
    : isAvailableAsInput = input,
      isAvailableAsOutput = output;