Show / Hide Table of Contents

Class Empty

A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance:

service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }

The JSON representation for Empty is empty JSON object {}.

Inheritance
System.Object
Empty
Implements
IMessage<Empty>
IMessage
System.IEquatable<Empty>
IDeepCloneable<Empty>
Inherited Members
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Google.Protobuf.WellKnownTypes
Assembly: Google.Protobuf.dll
Syntax
public sealed class Empty : IMessage<Empty>, IMessage, IEquatable<Empty>, IDeepCloneable<Empty>

Constructors

Empty()

Declaration
public Empty()

Empty(Empty)

Declaration
public Empty(Empty other)
Parameters
Type Name Description
Empty other

Properties

Descriptor

Declaration
public static MessageDescriptor Descriptor { get; }
Property Value
Type Description
MessageDescriptor

Parser

Declaration
public static MessageParser<Empty> Parser { get; }
Property Value
Type Description
MessageParser<Empty>

Methods

CalculateSize()

Declaration
public int CalculateSize()
Returns
Type Description
System.Int32
Implements
IMessage.CalculateSize()

Clone()

Declaration
public Empty Clone()
Returns
Type Description
Empty
Implements
IDeepCloneable<T>.Clone()

Equals(Empty)

Declaration
public bool Equals(Empty other)
Parameters
Type Name Description
Empty other
Returns
Type Description
System.Boolean
Implements
System.IEquatable<T>.Equals(T)

Equals(Object)

Declaration
public override bool Equals(object other)
Parameters
Type Name Description
System.Object other
Returns
Type Description
System.Boolean
Overrides
System.Object.Equals(System.Object)

GetHashCode()

Declaration
public override int GetHashCode()
Returns
Type Description
System.Int32
Overrides
System.Object.GetHashCode()

MergeFrom(CodedInputStream)

Declaration
public void MergeFrom(CodedInputStream input)
Parameters
Type Name Description
CodedInputStream input
Implements
IMessage.MergeFrom(CodedInputStream)

MergeFrom(Empty)

Declaration
public void MergeFrom(Empty other)
Parameters
Type Name Description
Empty other
Implements
IMessage<T>.MergeFrom(T)

ToString()

Declaration
public override string ToString()
Returns
Type Description
System.String
Overrides
System.Object.ToString()

WriteTo(CodedOutputStream)

Declaration
public void WriteTo(CodedOutputStream output)
Parameters
Type Name Description
CodedOutputStream output
Implements
IMessage.WriteTo(CodedOutputStream)

Explicit Interface Implementations

IMessage.Descriptor

Declaration
MessageDescriptor IMessage.Descriptor { get; }
Returns
Type Description
MessageDescriptor
Implements
IMessage.Descriptor

Extension Methods

MessageExtensions.MergeFrom(IMessage, Byte[])
MessageExtensions.MergeFrom(IMessage, Byte[], Int32, Int32)
MessageExtensions.MergeFrom(IMessage, ByteString)
MessageExtensions.MergeFrom(IMessage, Stream)
MessageExtensions.MergeDelimitedFrom(IMessage, Stream)
MessageExtensions.ToByteArray(IMessage)
MessageExtensions.WriteTo(IMessage, Stream)
MessageExtensions.WriteDelimitedTo(IMessage, Stream)
MessageExtensions.ToByteString(IMessage)
MessageExtensions.IsInitialized(IMessage)
Back to top