| | 1 | | // Copyright (c) Microsoft Corporation. All rights reserved. |
| | 2 | | // Licensed under the MIT License. |
| | 3 | |
|
| | 4 | | namespace Azure.Messaging.ServiceBus.Management |
| | 5 | | { |
| | 6 | | /// <summary> |
| | 7 | | /// Matches none the messages arriving to be selected for the subscription. |
| | 8 | | /// </summary> |
| | 9 | | public sealed class FalseRuleFilter : SqlRuleFilter |
| | 10 | | { |
| | 11 | | /// <summary> |
| | 12 | | /// Initializes a new instance of the <see cref="FalseRuleFilter" /> class. |
| | 13 | | /// </summary> |
| | 14 | | public FalseRuleFilter() |
| 0 | 15 | | : base("1=0") |
| | 16 | | { |
| 0 | 17 | | } |
| | 18 | |
|
| | 19 | | internal override RuleFilter Clone() => |
| 0 | 20 | | new FalseRuleFilter(); |
| | 21 | |
|
| | 22 | | /// <summary> |
| | 23 | | /// Converts the current instance to its string representation. |
| | 24 | | /// </summary> |
| | 25 | | /// <returns>A string representation of the current instance.</returns> |
| | 26 | | public override string ToString() |
| | 27 | | { |
| 0 | 28 | | return "FalseRuleFilter"; |
| | 29 | | } |
| | 30 | |
|
| | 31 | | /// <inheritdoc/> |
| | 32 | | public override int GetHashCode() |
| | 33 | | { |
| 0 | 34 | | return base.GetHashCode(); |
| | 35 | | } |
| | 36 | |
|
| | 37 | | /// <inheritdoc/> |
| | 38 | | public override bool Equals(object obj) |
| | 39 | | { |
| 0 | 40 | | return obj is FalseRuleFilter; |
| | 41 | | } |
| | 42 | |
|
| | 43 | | /// <inheritdoc/> |
| | 44 | | public override bool Equals(RuleFilter other) |
| | 45 | | { |
| 0 | 46 | | return other is FalseRuleFilter; |
| | 47 | | } |
| | 48 | |
|
| | 49 | | /// <summary> |
| | 50 | | /// |
| | 51 | | /// </summary> |
| | 52 | | /// <param name="left"></param> |
| | 53 | | /// <param name="right"></param> |
| | 54 | | /// <returns></returns> |
| | 55 | | public static bool operator ==(FalseRuleFilter left, FalseRuleFilter right) |
| | 56 | | { |
| 0 | 57 | | if (ReferenceEquals(left, right)) |
| | 58 | | { |
| 0 | 59 | | return true; |
| | 60 | | } |
| | 61 | |
|
| 0 | 62 | | if (ReferenceEquals(left, null) || ReferenceEquals(right, null)) |
| | 63 | | { |
| 0 | 64 | | return false; |
| | 65 | | } |
| | 66 | |
|
| 0 | 67 | | return left.Equals(right); |
| | 68 | | } |
| | 69 | |
|
| | 70 | | /// <summary> |
| | 71 | | /// |
| | 72 | | /// </summary> |
| | 73 | | /// <param name="left"></param> |
| | 74 | | /// <param name="right"></param> |
| | 75 | | /// <returns></returns> |
| | 76 | | public static bool operator !=(FalseRuleFilter left, FalseRuleFilter right) |
| | 77 | | { |
| 0 | 78 | | return !(left == right); |
| | 79 | | } |
| | 80 | | } |
| | 81 | | } |