diff options
author | Jon Skeet <jonskeet@google.com> | 2015-06-23 20:04:39 +0100 |
---|---|---|
committer | Jon Skeet <jonskeet@google.com> | 2015-06-23 20:04:39 +0100 |
commit | 8c896b259ecda6160ad2839fab59fad71ae77a7c (patch) | |
tree | 07557a07d3bd0970c68a66d642bcd77ddaa4526e /csharp | |
parent | 6c1fe6ea3e4e3915fc4164c43230210f9a0ac24f (diff) | |
download | protobuf-8c896b259ecda6160ad2839fab59fad71ae77a7c.tar.gz protobuf-8c896b259ecda6160ad2839fab59fad71ae77a7c.tar.bz2 protobuf-8c896b259ecda6160ad2839fab59fad71ae77a7c.zip |
Implement requested changes for IMessage<T>
1) New line at end of file
2) Make IMessage<T> itself extend IEquatable<T> and IDeepCloneable<T>
Diffstat (limited to 'csharp')
-rw-r--r-- | csharp/src/ProtocolBuffers/IMessage.cs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/csharp/src/ProtocolBuffers/IMessage.cs b/csharp/src/ProtocolBuffers/IMessage.cs index 32dfcaff..5d662cfd 100644 --- a/csharp/src/ProtocolBuffers/IMessage.cs +++ b/csharp/src/ProtocolBuffers/IMessage.cs @@ -34,6 +34,7 @@ #endregion
+using System;
using Google.Protobuf.FieldAccess;
namespace Google.Protobuf
@@ -84,7 +85,7 @@ namespace Google.Protobuf /// the implementation class.
/// </summary>
/// <typeparam name="T">The message type.</typeparam>
- public interface IMessage<T> : IMessage where T : IMessage<T>
+ public interface IMessage<T> : IMessage, IEquatable<T>, IDeepCloneable<T> where T : IMessage<T>
{
/// <summary>
/// Merges the given message into this one.
@@ -98,8 +99,8 @@ namespace Google.Protobuf /// Generic interface for a deeply cloneable type.
/// <summary>
/// <remarks>
- /// In practice, all generated messages implement this interface.
- /// However, due to the type constraint on <c>T</c> in <see cref="IMessage{T}"/>,
+ /// All generated messages implement this interface, but so do some non-message types.
+ /// Additionally, due to the type constraint on <c>T</c> in <see cref="IMessage{T}"/>,
/// it is simpler to keep this as a separate interface.
/// </remarks>
/// <typeparam name="T">The type itself, returned by the <see cref="Clone"/> method.</typeparam>
@@ -111,4 +112,4 @@ namespace Google.Protobuf /// <returns>A deep clone of this object.</returns>
T Clone();
}
-}
\ No newline at end of file +}
|