using System;

namespace ZB.MOM.WW.CBDD.Core.Collections;

public readonly struct SchemaVersion
{
    /// <summary>
    /// Gets the schema version number.
    /// </summary>
    public int Version { get; }

    /// <summary>
    /// Gets the schema hash.
    /// </summary>
    public long Hash { get; }

    /// <summary>
    /// Initializes a new instance of the <see cref="SchemaVersion"/> struct.
    /// </summary>
    /// <param name="version">The schema version number.</param>
    /// <param name="hash">The schema hash.</param>
    public SchemaVersion(int version, long hash)
    {
        Version = version;
        Hash = hash;
    }

    /// <inheritdoc />
    public override string ToString() => $"v{Version} (0x{Hash:X16})";
}
