Send feedback
Class Value (3.15.8)
Stay organized with collections
Save and categorize content based on your preferences.
Version 3.15.8 keyboard_arrow_down
public sealed class Value : object, IMessage<Value>, IEquatable<Value>, IDeepCloneable<Value>, IBufferMessage, IMessage
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.
Namespace
Google.Protobuf.WellKnownTypes
Assembly
Google.Protobuf.dll
Constructors
Value()
Value(Value)
public Value(Value other)
Parameter Name Description other
Value
Fields
BoolValueFieldNumber
public const int BoolValueFieldNumber = null
Field number for the "bool_value" field.
Field Value Type Description Int32
ListValueFieldNumber
public const int ListValueFieldNumber = null
Field number for the "list_value" field.
Field Value Type Description Int32
NullValueFieldNumber
public const int NullValueFieldNumber = null
Field number for the "null_value" field.
Field Value Type Description Int32
NumberValueFieldNumber
public const int NumberValueFieldNumber = null
Field number for the "number_value" field.
Field Value Type Description Int32
StringValueFieldNumber
public const int StringValueFieldNumber = null
Field number for the "string_value" field.
Field Value Type Description Int32
StructValueFieldNumber
public const int StructValueFieldNumber = null
Field number for the "struct_value" field.
Field Value Type Description Int32
Properties
BoolValue
public bool BoolValue { get; set; }
Represents a boolean value.
Property Value Type Description Boolean
Descriptor
public static MessageDescriptor Descriptor { get; }
KindCase
public Value.KindOneofCase KindCase { get; }
ListValue
public ListValue ListValue { get; set; }
Represents a repeated Value
.
NullValue
public NullValue NullValue { get; set; }
NumberValue
public double NumberValue { get; set; }
Represents a double value.
Property Value Type Description Double
Parser
public static MessageParser<Value> Parser { get; }
StringValue
public string StringValue { get; set; }
Represents a string value.
Property Value Type Description String
StructValue
public Struct StructValue { get; set; }
Represents a structured value.
Property Value Type Description Struct
Methods
CalculateSize()
public int CalculateSize()
Returns Type Description Int32
ClearKind()
Clone()
Returns Type Description Value
Equals(Value)
public bool Equals(Value other)
Parameter Name Description other
Value
Equals(Object)
public override bool Equals(object other)
Parameter Name Description other
Object
ForBool(Boolean)
public static Value ForBool(bool value)
Convenience method to create a Value message with a Boolean value.
Parameter Name Description value
Boolean
Value to set for the BoolValue property.
Returns Type Description Value
A newly-created Value message with the given value.
ForList(Value[])
public static Value ForList(params Value[] values)
Convenience method to create a Value message with an initial list of values.
Parameter Name Description values
Value []
Returns Type Description Value
A newly-created Value message an initial list value.
Remarks
ForNull()
public static Value ForNull()
Convenience method to create a Value message with a null initial value.
Returns Type Description Value
A newly-created Value message a null initial value.
ForNumber(Double)
public static Value ForNumber(double value)
Convenience method to create a Value message with a number value.
Parameter Name Description value
Double
Value to set for the NumberValue property.
Returns Type Description Value
A newly-created Value message with the given value.
ForString(String)
public static Value ForString(string value)
Convenience method to create a Value message with a string value.
Parameter Name Description value
String
Value to set for the StringValue property.
Returns Type Description Value
A newly-created Value message with the given value.
ForStruct(Struct)
public static Value ForStruct(Struct value)
Convenience method to create a Value message with an initial struct value
Parameter Name Description value
Struct
Returns Type Description Value
A newly-created Value message an initial struct value.
Remarks
GetHashCode()
public override int GetHashCode()
Returns Type Description Int32
public void MergeFrom(CodedInputStream input)
MergeFrom(Value)
public void MergeFrom(Value other)
Parameter Name Description other
Value
ToString()
public override string ToString()
WriteTo(CodedOutputStream)
public void WriteTo(CodedOutputStream output)
Explicit Interface Implementations
IBufferMessage.InternalMergeFrom(ref ParseContext)
void IBufferMessage.InternalMergeFrom(ref ParseContext input)
IBufferMessage.InternalWriteTo(ref WriteContext)
void IBufferMessage.InternalWriteTo(ref WriteContext output)
IMessage.Descriptor
MessageDescriptor IMessage.Descriptor { get; }
Send feedback
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License , and code samples are licensed under the Apache 2.0 License . For details, see the Google Developers Site Policies . Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-11-19 UTC.
Need to tell us more?
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-11-19 UTC."],[],[]]