class Embeddable { static const TYPE_KEY = '_type'; static const INLINE_KEY = '_inline'; final String type; final bool inline; final Map _data; Embeddable(this.type, this.inline, Map data) : assert(type != null), assert(inline != null), _data = Map.from(data); Map toJson() { Map m = Map.from(_data); m[TYPE_KEY] = type; m[INLINE_KEY] = inline; return m; } }