Google.Protobuf.WellKnownTypes.Value

Value represents a dynamically typed value which can be either null, a number, a string, a boolean, a recursive struct value, or a list of values.

Summary

A producer of value is expected to set one of that variants, absence of any variant indicates an error.

The JSON representation for Value is JSON value.

Inheritance

Inherits from: pb::IMessage< Value >

Constructors and Destructors

Value()
Value(Value other)

Public types

KindOneofCase enum
Enum of possible cases for the "kind" oneof.

Properties

BoolValue
bool
Represents a boolean value.
Descriptor
pbr::MessageDescriptor
Descriptor
pbr::MessageDescriptor pb::IMessage.
KindCase
KindOneofCase
ListValue
global::Google.Protobuf.WellKnownTypes.ListValue
Represents a repeated Value.
NullValue
global::Google.Protobuf.WellKnownTypes.NullValue
Represents a null value.
NumberValue
double
Represents a double value.
Parser
pb::MessageParser< Value >
StringValue
string
Represents a string value.
StructValue
global::Google.Protobuf.WellKnownTypes.Struct
Represents a structured value.

Public attributes

BoolValueFieldNumber = 4
const int
Field number for the "bool_value" field.
ListValueFieldNumber = 6
const int
Field number for the "list_value" field.
NullValueFieldNumber = 1
const int
Field number for the "null_value" field.
NumberValueFieldNumber = 2
const int
Field number for the "number_value" field.
StringValueFieldNumber = 3
const int
Field number for the "string_value" field.
StructValueFieldNumber = 5
const int
Field number for the "struct_value" field.

Public functions

CalculateSize()
int
ClearKind()
void
Clone()
Value
Equals(object other)
override bool
Equals(Value other)
bool
GetHashCode()
override int
MergeFrom(Value other)
void
MergeFrom(pb::CodedInputStream input)
void
ToString()
override string
WriteTo(pb::CodedOutputStream output)
void

Public static functions

ForBool(bool value)
Value
Convenience method to create a Value message with a Boolean value.
ForList(params Value[] values)
Value
Convenience method to create a Value message with an initial list of values.
ForNull()
Value
Convenience method to create a Value message with a null initial value.
ForNumber(double value)
Value
Convenience method to create a Value message with a number value.
ForString(string value)
Value
Convenience method to create a Value message with a string value.
ForStruct(Struct value)
Value
Convenience method to create a Value message with an initial struct value

Public types

KindOneofCase

 KindOneofCase

Enum of possible cases for the "kind" oneof.

Properties

BoolValue

bool BoolValue

Represents a boolean value.

Descriptor

pbr::MessageDescriptor Descriptor

Descriptor

pbr::MessageDescriptor pb::IMessage. Descriptor

KindCase

KindOneofCase KindCase

ListValue

global::Google.Protobuf.WellKnownTypes.ListValue ListValue

Represents a repeated Value.

NullValue

global::Google.Protobuf.WellKnownTypes.NullValue NullValue

Represents a null value.

NumberValue

double NumberValue

Represents a double value.

Parser

pb::MessageParser< Value > Parser

StringValue

string StringValue

Represents a string value.

StructValue

global::Google.Protobuf.WellKnownTypes.Struct StructValue

Represents a structured value.

Public attributes

BoolValueFieldNumber

const int BoolValueFieldNumber = 4

Field number for the "bool_value" field.

ListValueFieldNumber

const int ListValueFieldNumber = 6

Field number for the "list_value" field.

NullValueFieldNumber

const int NullValueFieldNumber = 1

Field number for the "null_value" field.

NumberValueFieldNumber

const int NumberValueFieldNumber = 2

Field number for the "number_value" field.

StringValueFieldNumber

const int StringValueFieldNumber = 3

Field number for the "string_value" field.

StructValueFieldNumber

const int StructValueFieldNumber = 5

Field number for the "struct_value" field.

Public functions

CalculateSize

int CalculateSize()

ClearKind

void ClearKind()

Clone

Value Clone()

Equals

override bool Equals(
  object other
)

Equals

bool Equals(
  Value other
)

GetHashCode

override int GetHashCode()

MergeFrom

void MergeFrom(
  Value other
)

MergeFrom

void MergeFrom(
  pb::CodedInputStream input
)

ToString

override string ToString()

Value

 Value()

Value

 Value(
  Value other
)

WriteTo

void WriteTo(
  pb::CodedOutputStream output
)

Public static functions

ForBool

Value ForBool(
  bool value
)

Convenience method to create a Value message with a Boolean value.

Details
Parameters
value
Value to set for the BoolValue property.
Returns
A newly-created Value message with the given value.

ForList

Value ForList(
  params Value[] values
)

Convenience method to create a Value message with an initial list of values.

The values provided are not cloned; the references are copied directly.

Details
Returns
A newly-created Value message an initial list value.

ForNull

Value ForNull()

Convenience method to create a Value message with a null initial value.

Details
Returns
A newly-created Value message a null initial value.

ForNumber

Value ForNumber(
  double value
)

Convenience method to create a Value message with a number value.

Details
Parameters
value
Value to set for the NumberValue property.
Returns
A newly-created Value message with the given value.

ForString

Value ForString(
  string value
)

Convenience method to create a Value message with a string value.

Details
Parameters
value
Value to set for the StringValue property.
Returns
A newly-created Value message with the given value.

ForStruct

Value ForStruct(
  Struct value
)

Convenience method to create a Value message with an initial struct value

The value provided is not cloned; the reference is copied directly.

Details
Returns
A newly-created Value message an initial struct value.