public TextState() : base(NoOp, typeof(string), 1, EmptyTextData, 1, Metadata.NullMetadata()) { }
public ObjectState() : base(NoOp, typeof(T), 1, EmptyObjectData, 1, Metadata.NullMetadata()) { }
public TextState(string id, Type type, int typeVersion, string data, int dataVersion, Metadata metadata) : base(id, type, typeVersion, data, dataVersion, metadata) { }
public ObjectState(string id, Type type, int typeVersion, T data, int dataVersion, Metadata metadata) : base(id, type, typeVersion, data, dataVersion, metadata) { }
public BinaryState() : base(NoOp, typeof(object), 1, EmptyBytesData, 1, Metadata.NullMetadata()) { }
public BinaryState(string id, Type type, int typeVersion, byte[] data, int dataVersion, Metadata metadata) : base(id, type, typeVersion, data, dataVersion, metadata) { }
protected State(string id, Type type, int typeVersion, T data, int dataVersion) : this(id, type, typeVersion, data, dataVersion, Metadata.NullMetadata()) { }
protected State(string id, Type type, int typeVersion, T data, int dataVersion, Metadata metadata) { if (id == null) { throw new ArgumentNullException(nameof(id), "State id must not be null."); } if (type == null) { throw new ArgumentNullException(nameof(type), "State type must not be null."); } if (typeVersion <= 0) { throw new ArgumentOutOfRangeException(nameof(typeVersion), "State typeVersion must be greater than 0."); } if (data == null) { throw new ArgumentNullException(nameof(data), "State data must not be null."); } if (dataVersion <= 0) { throw new ArgumentOutOfRangeException(nameof(dataVersion), "State dataVersion must be greater than 0."); } Id = id; Type = type.AssemblyQualifiedName; TypeVersion = typeVersion; Data = data; DataVersion = dataVersion; Metadata = metadata ?? Metadata.NullMetadata(); }