forked from kurrent-io/KurrentDB
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRawStreamMetadataResult.cs
46 lines (43 loc) · 1.69 KB
/
RawStreamMetadataResult.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
using EventStore.ClientAPI.Common.Utils;
using EventStore.ClientAPI.Internal;
namespace EventStore.ClientAPI
{
/// <summary>
/// Represents stream metadata as a series of properties for system
/// data and a byte array for user metadata.
/// </summary>
public struct RawStreamMetadataResult
{
/// <summary>
/// The name of the stream.
/// </summary>
public readonly string Stream;
/// <summary>
/// True if the stream is soft-deleted.
/// </summary>
public readonly bool IsStreamDeleted;
/// <summary>
/// The version of the metadata format.
/// </summary>
public readonly long MetastreamVersion;
/// <summary>
/// A byte array containing user-specified metadata.
/// </summary>
public readonly byte[] StreamMetadata;
/// <summary>
/// Constructs a new instance of <see cref="RawStreamMetadataResult"/>.
/// </summary>
/// <param name="stream">The name of the stream.</param>
/// <param name="isStreamDeleted">True if the stream is soft-deleted.</param>
/// <param name="metastreamVersion">The version of the metadata format.</param>
/// <param name="streamMetadata">A byte array containing user-specified metadata.</param>
public RawStreamMetadataResult(string stream, bool isStreamDeleted, long metastreamVersion, byte[] streamMetadata)
{
Ensure.NotNullOrEmpty(stream, "stream");
Stream = stream;
IsStreamDeleted = isStreamDeleted;
MetastreamVersion = metastreamVersion;
StreamMetadata = streamMetadata ?? Empty.ByteArray;
}
}
}