88namespace StackExchange . Redis ;
99
1010/// <summary>
11- /// Represents a check for an existing value, for use in conditional operations such as <c>DELEX</c> or <c>SET ... IFEQ</c> .
11+ /// Represents a check for an existing value - this could be existence (NX/XX), equality (IFEQ/IFNE), or digest equality (IFDEQ/IFDNE) .
1212/// </summary>
13- [ Experimental ( Experiments . Server_8_4 , UrlFormat = Experiments . UrlFormat ) ]
1413public readonly struct ValueCondition
1514{
1615 internal enum ConditionKind : byte
@@ -108,7 +107,11 @@ public override string ToString()
108107 /// <summary>
109108 /// Gets the underlying value for this condition.
110109 /// </summary>
111- public RedisValue Value => _value ;
110+ public RedisValue Value
111+ {
112+ [ Experimental ( Experiments . Server_8_4 , UrlFormat = Experiments . UrlFormat ) ]
113+ get => _value ;
114+ }
112115
113116 private ValueCondition ( ConditionKind kind , in RedisValue value )
114117 {
@@ -136,26 +139,32 @@ private ValueCondition(ConditionKind kind, in RedisValue value)
136139 /// <summary>
137140 /// Create a value equality condition with the supplied value.
138141 /// </summary>
142+ [ Experimental ( Experiments . Server_8_4 , UrlFormat = Experiments . UrlFormat ) ]
139143 public static ValueCondition Equal ( in RedisValue value ) => new ( ConditionKind . ValueEquals , value ) ;
140144
141145 /// <summary>
142146 /// Create a value non-equality condition with the supplied value.
143147 /// </summary>
148+ [ Experimental ( Experiments . Server_8_4 , UrlFormat = Experiments . UrlFormat ) ]
149+
144150 public static ValueCondition NotEqual ( in RedisValue value ) => new ( ConditionKind . ValueNotEquals , value ) ;
145151
146152 /// <summary>
147153 /// Create a digest equality condition, computing the digest of the supplied value.
148154 /// </summary>
155+ [ Experimental ( Experiments . Server_8_4 , UrlFormat = Experiments . UrlFormat ) ]
149156 public static ValueCondition DigestEqual ( in RedisValue value ) => value . Digest ( ) ;
150157
151158 /// <summary>
152159 /// Create a digest non-equality condition, computing the digest of the supplied value.
153160 /// </summary>
161+ [ Experimental ( Experiments . Server_8_4 , UrlFormat = Experiments . UrlFormat ) ]
154162 public static ValueCondition DigestNotEqual ( in RedisValue value ) => ! value . Digest ( ) ;
155163
156164 /// <summary>
157165 /// Calculate the digest of a payload, as an equality test. For a non-equality test, use <see cref="NotEqual"/> on the result.
158166 /// </summary>
167+ [ Experimental ( Experiments . Server_8_4 , UrlFormat = Experiments . UrlFormat ) ]
159168 public static ValueCondition CalculateDigest ( ReadOnlySpan < byte > value )
160169 {
161170 // the internal impl of XxHash3 uses ulong (not Span<byte>), so: use
@@ -167,6 +176,7 @@ public static ValueCondition CalculateDigest(ReadOnlySpan<byte> value)
167176 /// <summary>
168177 /// Creates an equality match based on the specified digest bytes.
169178 /// </summary>
179+ [ Experimental ( Experiments . Server_8_4 , UrlFormat = Experiments . UrlFormat ) ]
170180 public static ValueCondition ParseDigest ( ReadOnlySpan < char > digest )
171181 {
172182 if ( digest . Length != 2 * DigestBytes ) ThrowDigestLength ( ) ;
@@ -201,6 +211,7 @@ private static byte ParseNibble(int b)
201211 /// <summary>
202212 /// Creates an equality match based on the specified digest bytes.
203213 /// </summary>
214+ [ Experimental ( Experiments . Server_8_4 , UrlFormat = Experiments . UrlFormat ) ]
204215 public static ValueCondition ParseDigest ( ReadOnlySpan < byte > digest )
205216 {
206217 if ( digest . Length != 2 * DigestBytes ) ThrowDigestLength ( ) ;
@@ -341,6 +352,7 @@ internal static Span<char> WriteHex(long value, Span<char> target)
341352 /// <summary>
342353 /// Convert a value condition to a digest condition.
343354 /// </summary>
355+ [ Experimental ( Experiments . Server_8_4 , UrlFormat = Experiments . UrlFormat ) ]
344356 public ValueCondition AsDigest ( ) => _kind switch
345357 {
346358 ConditionKind . ValueEquals => _value . Digest ( ) ,
0 commit comments