Class Empty

Stay organized with collections Save and categorize content based on your preferences.
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
TypeNameDescription
Emptyother

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
TypeNameDescription
Emptyother
Returns
TypeDescription
Boolean

Equals(Object)

public override bool Equals(object other)
Parameter
TypeNameDescription
Objectother
Returns
TypeDescription
Boolean

GetHashCode()

public override int GetHashCode()
Returns
TypeDescription
Int32

MergeFrom(CodedInputStream)

public void MergeFrom(CodedInputStream input)
Parameter
TypeNameDescription
CodedInputStreaminput

MergeFrom(Empty)

public void MergeFrom(Empty other)
Parameter
TypeNameDescription
Emptyother

ToString()

public override string ToString()
Returns
TypeDescription
String

WriteTo(CodedOutputStream)

public void WriteTo(CodedOutputStream output)
Parameter
TypeNameDescription
CodedOutputStreamoutput

Explicit Interface Implementations

IBufferMessage.InternalMergeFrom(ref ParseContext)

void IBufferMessage.InternalMergeFrom(ref ParseContext input)
Parameter
TypeNameDescription
ParseContextinput

IBufferMessage.InternalWriteTo(ref WriteContext)

void IBufferMessage.InternalWriteTo(ref WriteContext output)
Parameter
TypeNameDescription
WriteContextoutput

IMessage.Descriptor

MessageDescriptor IMessage.Descriptor { get; }
Returns
TypeDescription
MessageDescriptor

Implements

IEquatable<>