Google.Cloud.Bigtable.Common.V2 - Struct BigtableByteString (3.1.0)

public struct BigtableByteString : IComparable, IComparable<BigtableByteString>, IEquatable<BigtableByteString>, IEnumerable<byte>, IEnumerable

Reference documentation and code samples for the Google.Cloud.Bigtable.Common.V2 struct BigtableByteString.

A sequence of bytes which can be used for a row key, column qualifier, or cell value.

Namespace

Google.Cloud.Bigtable.Common.V2

Assembly

Google.Cloud.Bigtable.Common.V2.dll

Constructors

BigtableByteString(ByteString)

public BigtableByteString(ByteString value)

Creates a BigtableByteString value from a byte string.

Parameter
NameDescription
valueByteString

The byte string making up the value. May be null in which case the empty byte string is used.

BigtableByteString(params byte[])

public BigtableByteString(params byte[] value)

Creates a BigtableByteString value from an array of bytes.

Parameter
NameDescription
valuebyte

The bytes making up the byte string. May be null in which case the empty byte string is used.

BigtableByteString(long)

public BigtableByteString(long value)

Creates a BigtableByteString value from the big-endian encoding of a signed 64-bit value.

Parameter
NameDescription
valuelong

The 64-bit value which should be used to initialize the byte string.

BigtableByteString(string)

public BigtableByteString(string valueAsUtf8)

Creates a BigtableByteString value from the UTF-8 encoding of a string.

Parameter
NameDescription
valueAsUtf8string

The value whose UTF-8 representation should be used to initialize the byte string. May be null in which case the empty byte string is used.

Properties

IsEmpty

public bool IsEmpty { get; }

Returns true if the byte string is empty, false otherwise.

Property Value
TypeDescription
bool

this[int]

public byte this[int index] { get; }

Returns the byte at index index.

Parameter
NameDescription
indexint

The index in the byte string to return. Must be greater than or equal to 0, and less than Length.

Property Value
TypeDescription
byte

The byte at index index.

Length

public int Length { get; }

Gets the number of bytes in the byte string.

Property Value
TypeDescription
int

Value

public ByteString Value { get; }

Gets the underlying byte string.

Property Value
TypeDescription
ByteString

Methods

Compare(BigtableByteString, BigtableByteString)

public static int Compare(BigtableByteString x, BigtableByteString y)

Compares two BigtableByteString values lexicographically.

Parameters
NameDescription
xBigtableByteString

Left value to compare

yBigtableByteString

Right value to compare

Returns
TypeDescription
int

true if x is less than y; otherwise false.

CompareTo(BigtableByteString)

public int CompareTo(BigtableByteString other)

Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.

Parameter
NameDescription
otherBigtableByteString

An object to compare with this instance.

Returns
TypeDescription
int

A value that indicates the relative order of the objects being compared. The return value has these meanings:
Value

Meaning

Less than zero

This instance precedes other in the sort order.

Zero

This instance occurs in the same position in the sort order as other.

Greater than zero

This instance follows other in the sort order.

CompareTo(object)

public int CompareTo(object obj)

Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.

Parameter
NameDescription
objobject

An object to compare with this instance.

Returns
TypeDescription
int

A value that indicates the relative order of the objects being compared. The return value has these meanings:
Value

Meaning

Less than zero

This instance precedes obj in the sort order.

Zero

This instance occurs in the same position in the sort order as obj.

Greater than zero

This instance follows obj in the sort order.

Exceptions
TypeDescription
ArgumentException

obj is not the same type as this instance.

GetEnumerator()

public IEnumerator<byte> GetEnumerator()

Returns an enumerator that iterates through the collection.

Returns
TypeDescription
IEnumeratorbyte

An enumerator that can be used to iterate through the collection.

GetHashCode()

public override int GetHashCode()

Returns the hash code for this instance.

Returns
TypeDescription
int

A 32-bit signed integer that is the hash code for this instance.

Overrides

ToString()

public override string ToString()

Returns the fully qualified type name of this instance.

Returns
TypeDescription
string

The fully qualified type name.

Overrides

Operators

operator ==(BigtableByteString, BigtableByteString)

public static bool operator ==(BigtableByteString x, BigtableByteString y)

Operator overload to compare two BigtableByteString values for equality.

Parameters
NameDescription
xBigtableByteString

Left value to compare

yBigtableByteString

Right value to compare

Returns
TypeDescription
bool

true if x is equal to y; otherwise false.

explicit operator ByteString(BigtableByteString)

public static explicit operator ByteString(BigtableByteString value)

Converts the BigtableByteString value to its underlying byte string.

Parameter
NameDescription
valueBigtableByteString

The BigtableByteString value to convert.

Returns
TypeDescription
ByteString

explicit operator byte[](BigtableByteString)

public static explicit operator byte[](BigtableByteString value)

Converts the BigtableByteString value to its underlying byte array.

Parameter
NameDescription
valueBigtableByteString

The BigtableByteString value to convert.

Returns
TypeDescription
byte

explicit operator long(BigtableByteString)

public static explicit operator long(BigtableByteString value)

Converts the BigtableByteString value to its a signed 64-bit value assuming it is big-endian encoded.

Parameter
NameDescription
valueBigtableByteString

The BigtableByteString value to convert.

Returns
TypeDescription
long

explicit operator string(BigtableByteString)

public static explicit operator string(BigtableByteString value)

Converts the BigtableByteString value to a string assuming it is UTF-8 encoded.

Parameter
NameDescription
valueBigtableByteString

The BigtableByteString value to convert.

Returns
TypeDescription
string

operator >(BigtableByteString, BigtableByteString)

public static bool operator >(BigtableByteString x, BigtableByteString y)

Operator overload to compare two BigtableByteString values.

Parameters
NameDescription
xBigtableByteString

Left value to compare

yBigtableByteString

Right value to compare

Returns
TypeDescription
bool

true if x is greater than y; otherwise false.

operator >=(BigtableByteString, BigtableByteString)

public static bool operator >=(BigtableByteString x, BigtableByteString y)

Operator overload to compare two BigtableByteString values.

Parameters
NameDescription
xBigtableByteString

Left value to compare

yBigtableByteString

Right value to compare

Returns
TypeDescription
bool

true if x is greater than or equal y; otherwise false.

implicit operator BigtableByteString(ByteString)

public static implicit operator BigtableByteString(ByteString value)

Converts a byte string to a BigtableByteString value.

Parameter
NameDescription
valueByteString

The byte string making up the value. May be null in which case the empty byte string is used.

Returns
TypeDescription
BigtableByteString

implicit operator BigtableByteString(byte[])

public static implicit operator BigtableByteString(byte[] value)

Converts a byte array to a BigtableByteString value.

Parameter
NameDescription
valuebyte

The bytes making up the byte string. May be null in which case the empty byte string is used.

Returns
TypeDescription
BigtableByteString

implicit operator BigtableByteString(long)

public static implicit operator BigtableByteString(long value)

Converts the big-endian encoding of a signed 64-bit value to a BigtableByteString value.

Parameter
NameDescription
valuelong

The 64-bit value which should be used to initialize the byte string.

Returns
TypeDescription
BigtableByteString

implicit operator BigtableByteString(string)

public static implicit operator BigtableByteString(string valueAsUtf8)

Converts the UTF-8 encoding of a string to a BigtableByteString value.

Parameter
NameDescription
valueAsUtf8string

The value whose UTF-8 representation should be used to initialize the byte string. May be null in which case the empty byte string is used.

Returns
TypeDescription
BigtableByteString

operator !=(BigtableByteString, BigtableByteString)

public static bool operator !=(BigtableByteString x, BigtableByteString y)

Operator overload to compare two BigtableByteString values for inequality.

Parameters
NameDescription
xBigtableByteString

Left value to compare

yBigtableByteString

Right value to compare

Returns
TypeDescription
bool

true if x is not equal to y; otherwise false.

operator <(BigtableByteString, BigtableByteString)

public static bool operator <(BigtableByteString x, BigtableByteString y)

Operator overload to compare two BigtableByteString values.

Parameters
NameDescription
xBigtableByteString

Left value to compare

yBigtableByteString

Right value to compare

Returns
TypeDescription
bool

true if x is less than y; otherwise false.

operator <=(BigtableByteString, BigtableByteString)

public static bool operator <=(BigtableByteString x, BigtableByteString y)

Operator overload to compare two BigtableByteString values.

Parameters
NameDescription
xBigtableByteString

Left value to compare

yBigtableByteString

Right value to compare

Returns
TypeDescription
bool

true if x is less than or equal y; otherwise false.