Class 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. 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
System.Object
Value
Inherited Members
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetType()
System.Object.MemberwiseClone()
Assembly: Google.Protobuf.dll
Syntax
public sealed class Value : IMessage<Value>, IMessage, IEquatable<Value>, IDeepCloneable<Value>
Constructors
Value()
Declaration
Value(Value)
Declaration
public Value(Value other)
Parameters
Type |
Name |
Description |
Value |
other |
|
Fields
BoolValueFieldNumber
Field number for the "bool_value" field.
Declaration
public const int BoolValueFieldNumber = 4
Field Value
Type |
Description |
System.Int32 |
|
ListValueFieldNumber
Field number for the "list_value" field.
Declaration
public const int ListValueFieldNumber = 6
Field Value
Type |
Description |
System.Int32 |
|
NullValueFieldNumber
Field number for the "null_value" field.
Declaration
public const int NullValueFieldNumber = 1
Field Value
Type |
Description |
System.Int32 |
|
NumberValueFieldNumber
Field number for the "number_value" field.
Declaration
public const int NumberValueFieldNumber = 2
Field Value
Type |
Description |
System.Int32 |
|
StringValueFieldNumber
Field number for the "string_value" field.
Declaration
public const int StringValueFieldNumber = 3
Field Value
Type |
Description |
System.Int32 |
|
StructValueFieldNumber
Field number for the "struct_value" field.
Declaration
public const int StructValueFieldNumber = 5
Field Value
Type |
Description |
System.Int32 |
|
Properties
BoolValue
Represents a boolean value.
Declaration
public bool BoolValue { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
Descriptor
Declaration
public static MessageDescriptor Descriptor { get; }
Property Value
KindCase
Declaration
public Value.KindOneofCase KindCase { get; }
Property Value
ListValue
Represents a repeated Value
.
Declaration
public ListValue ListValue { get; set; }
Property Value
NullValue
Declaration
public NullValue NullValue { get; set; }
Property Value
NumberValue
Represents a double value.
Declaration
public double NumberValue { get; set; }
Property Value
Type |
Description |
System.Double |
|
Parser
Declaration
public static MessageParser<Value> Parser { get; }
Property Value
StringValue
Represents a string value.
Declaration
public string StringValue { get; set; }
Property Value
Type |
Description |
System.String |
|
StructValue
Represents a structured value.
Declaration
public Struct StructValue { get; set; }
Property Value
Methods
CalculateSize()
Declaration
public int CalculateSize()
Returns
Type |
Description |
System.Int32 |
|
Implements
ClearKind()
Declaration
Clone()
Declaration
Returns
Implements
Equals(Value)
Declaration
public bool Equals(Value other)
Parameters
Type |
Name |
Description |
Value |
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)
ForBool(Boolean)
Convenience method to create a Value message with a Boolean value.
Declaration
public static Value ForBool(bool value)
Parameters
Type |
Name |
Description |
System.Boolean |
value |
Value to set for the BoolValue property.
|
Returns
Type |
Description |
Value |
A newly-created Value message with the given value.
|
ForList(Value[])
Convenience method to create a Value message with an initial list of values.
Declaration
public static Value ForList(params Value[] values)
Parameters
Type |
Name |
Description |
Value[] |
values |
|
Returns
Type |
Description |
Value |
A newly-created Value message an initial list value.
|
ForNull()
Convenience method to create a Value message with a null initial value.
Declaration
public static Value ForNull()
Returns
Type |
Description |
Value |
A newly-created Value message a null initial value.
|
ForNumber(Double)
Convenience method to create a Value message with a number value.
Declaration
public static Value ForNumber(double value)
Parameters
Type |
Name |
Description |
System.Double |
value |
Value to set for the NumberValue property.
|
Returns
Type |
Description |
Value |
A newly-created Value message with the given value.
|
ForString(String)
Convenience method to create a Value message with a string value.
Declaration
public static Value ForString(string value)
Parameters
Type |
Name |
Description |
System.String |
value |
Value to set for the StringValue property.
|
Returns
Type |
Description |
Value |
A newly-created Value message with the given value.
|
ForStruct(Struct)
Convenience method to create a Value message with an initial struct value
Declaration
public static Value ForStruct(Struct value)
Parameters
Type |
Name |
Description |
Struct |
value |
|
Returns
Type |
Description |
Value |
A newly-created Value message an initial struct value.
|
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Type |
Description |
System.Int32 |
|
Overrides
System.Object.GetHashCode()
Declaration
public void MergeFrom(CodedInputStream input)
Parameters
Implements
MergeFrom(Value)
Declaration
public void MergeFrom(Value other)
Parameters
Type |
Name |
Description |
Value |
other |
|
Implements
ToString()
Declaration
public override string ToString()
Returns
Type |
Description |
System.String |
|
Overrides
System.Object.ToString()
WriteTo(CodedOutputStream)
Declaration
public void WriteTo(CodedOutputStream output)
Parameters
Implements
Explicit Interface Implementations
IMessage.Descriptor
Declaration
MessageDescriptor IMessage.Descriptor { get; }
Returns
Implements
Extension Methods