Class Empty (3.15.8)

public sealed class Empty : object, IMessage<Empty>, IEquatable<Empty>, IDeepCloneable<Empty>, IBufferMessage, IMessage

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

Object > Empty

Namespace

Google.Protobuf.WellKnownTypes

Assembly

Google.Protobuf.dll

Constructors

Empty()

public Empty()

Empty(Empty)

public Empty(Empty other)
Parameter
NameDescription
otherEmpty

Properties

Descriptor

public static MessageDescriptor Descriptor { get; }
Property Value
TypeDescription
MessageDescriptor

Parser

public static MessageParser<Empty> Parser { get; }
Property Value
TypeDescription
MessageParser<Empty>

Methods

CalculateSize()

public int CalculateSize()
Returns
TypeDescription
Int32

Clone()

public Empty Clone()
Returns
TypeDescription
Empty

Equals(Empty)

public bool Equals(Empty other)
Parameter
NameDescription
otherEmpty
Returns
TypeDescription
Boolean

Equals(Object)

public override bool Equals(object other)
Parameter
NameDescription
otherObject
Returns
TypeDescription
Boolean

GetHashCode()

public override int GetHashCode()
Returns
TypeDescription
Int32

MergeFrom(CodedInputStream)

public void MergeFrom(CodedInputStream input)
Parameter
NameDescription
inputCodedInputStream

MergeFrom(Empty)

public void MergeFrom(Empty other)
Parameter
NameDescription
otherEmpty

ToString()

public override string ToString()
Returns
TypeDescription
String

WriteTo(CodedOutputStream)

public void WriteTo(CodedOutputStream output)
Parameter
NameDescription
outputCodedOutputStream

Explicit Interface Implementations

IBufferMessage.InternalMergeFrom(ref ParseContext)

void IBufferMessage.InternalMergeFrom(ref ParseContext input)
Parameter
NameDescription
inputParseContext

IBufferMessage.InternalWriteTo(ref WriteContext)

void IBufferMessage.InternalWriteTo(ref WriteContext output)
Parameter
NameDescription
outputWriteContext

IMessage.Descriptor

MessageDescriptor IMessage.Descriptor { get; }
Returns
TypeDescription
MessageDescriptor