Class FieldValue
A value to encode. Numbers carry the components of a numeric field, or the flattened elements of a list; Integers the components of a 64-bit integer field; Text and Bytes carry the rest.
public sealed class FieldValue
- Inheritance
-
FieldValue
- Inherited Members
Constructors
FieldValue()
public FieldValue()
Properties
Bytes
Bytes, for a bytes or blob field.
public byte[] Bytes { get; init; }
Property Value
- byte[]
Elements
A collection's elements (W34), each the values of its element fields in wire order (Ordinal); they are the ones sent.
public FieldValue[][] Elements { get; init; }
Property Value
- FieldValue[][]
Integers
A 64-bit integer field's components as bit patterns (W32): a signed value's two's complement. A 64-bit field given Numbers instead encodes them when each is an integer in the codec's range — exactly representable, so nothing is rounded.
public ulong[] Integers { get; init; }
Property Value
- ulong[]
Numbers
Numeric components, or a list's flattened element components.
public double[] Numbers { get; init; }
Property Value
- double[]
Text
Text, for a str field.
public string Text { get; init; }
Property Value
Total
A collection's total: how many elements the entity holds, at least Elements' count; 0 means exactly those.
public int Total { get; init; }
Property Value
Methods
Of(byte[])
Raw bytes.
public static FieldValue Of(byte[] bytes)
Parameters
bytesbyte[]The bytes.
Returns
- FieldValue
The field value.
Of(double)
A scalar.
public static FieldValue Of(double value)
Parameters
valuedoubleThe value.
Returns
- FieldValue
The field value.
Of(params double[])
A vector or quaternion.
public static FieldValue Of(params double[] components)
Parameters
componentsdouble[]The components.
Returns
- FieldValue
The field value.
Of(string)
A string.
public static FieldValue Of(string text)
Parameters
textstringThe text.
Returns
- FieldValue
The field value.
OfElements(params FieldValue[][])
A collection of elements, every one of them sent.
public static FieldValue OfElements(params FieldValue[][] elements)
Parameters
elementsFieldValue[][]Each element's field values, in wire order.
Returns
- FieldValue
The field value.
OfInt64(params long[])
Signed 64-bit components, for an i64 or vari64 field.
public static FieldValue OfInt64(params long[] components)
Parameters
componentslong[]The components.
Returns
- FieldValue
The field value.
OfUInt64(params ulong[])
Unsigned 64-bit components, for a u64 or varu64 field.
public static FieldValue OfUInt64(params ulong[] components)
Parameters
componentsulong[]The components.
Returns
- FieldValue
The field value.