| | | 1 | | // Copyright (c) ZeroC, Inc. |
| | | 2 | | |
| | | 3 | | namespace IceRpc.Features; |
| | | 4 | | |
| | | 5 | | /// <summary>Default implementation of <see cref="ICompressFeature" />.</summary> |
| | | 6 | | public sealed class CompressFeature : ICompressFeature |
| | | 7 | | { |
| | | 8 | | /// <summary>Gets an <see cref="ICompressFeature" /> with <see cref="Value" /> set to <see langword="true" />. |
| | | 9 | | /// </summary> |
| | | 10 | | /// <value>A shared <see cref="ICompressFeature" /> with <see cref="Value" /> set to <see langword="true" />. |
| | | 11 | | /// </value> |
| | 11 | 12 | | public static ICompressFeature Compress { get; } = new CompressFeature(true); |
| | | 13 | | |
| | | 14 | | /// <summary>Gets an <see cref="ICompressFeature" /> with <see cref="Value" /> set to <see langword="false" />. |
| | | 15 | | /// </summary> |
| | | 16 | | /// <value>A shared <see cref="ICompressFeature" /> with <see cref="Value" /> set to <see langword="false" />. |
| | | 17 | | /// </value> |
| | 1 | 18 | | public static ICompressFeature DoNotCompress { get; } = new CompressFeature(false); |
| | | 19 | | |
| | | 20 | | /// <inheritdoc/> |
| | 14 | 21 | | public bool Value { get; } |
| | | 22 | | |
| | 4 | 23 | | private CompressFeature(bool value) => Value = value; |
| | | 24 | | } |