[#28] Clients: Make immutable parameters
Signed-off-by: Pavel Gross <p.gross@yadro.com>
This commit is contained in:
parent
749000a090
commit
9bb7b5eff8
62 changed files with 2742 additions and 963 deletions
|
@ -1,6 +1,40 @@
|
|||
namespace FrostFS.SDK.Client;
|
||||
|
||||
public sealed class PrmContainerGet(FrostFsContainerId container, CallContext? ctx = null) : PrmBase(ctx)
|
||||
public readonly struct PrmContainerGet(FrostFsContainerId container, string[]? xheaders = null) : System.IEquatable<PrmContainerGet>
|
||||
{
|
||||
public FrostFsContainerId Container { get; set; } = container;
|
||||
public FrostFsContainerId Container { get; } = container;
|
||||
|
||||
/// <summary>
|
||||
/// FrostFS request X-Headers
|
||||
/// </summary>
|
||||
public string[] XHeaders { get; } = xheaders ?? [];
|
||||
|
||||
public override readonly bool Equals(object obj)
|
||||
{
|
||||
if (obj == null || obj is not PrmContainerGet)
|
||||
return false;
|
||||
|
||||
return Equals((PrmContainerGet)obj);
|
||||
}
|
||||
|
||||
public readonly bool Equals(PrmContainerGet other)
|
||||
{
|
||||
return GetHashCode() == other.GetHashCode();
|
||||
}
|
||||
|
||||
public override readonly int GetHashCode()
|
||||
{
|
||||
return Container.GetHashCode()
|
||||
^ XHeaders.GetHashCode();
|
||||
}
|
||||
|
||||
public static bool operator ==(PrmContainerGet left, PrmContainerGet right)
|
||||
{
|
||||
return left.Equals(right);
|
||||
}
|
||||
|
||||
public static bool operator !=(PrmContainerGet left, PrmContainerGet right)
|
||||
{
|
||||
return !(left == right);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue