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
Name Description
value ByteString

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
Name Description
value byte

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
Name Description
value long

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
Name Description
valueAsUtf8 string

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
Type Description
bool

this[int]

public byte this[int index] { get; }

Returns the byte at index index.

Parameter
Name Description
index int

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

Property Value
Type Description
byte

The byte at index index.

Length

public int Length { get; }

Gets the number of bytes in the byte string.

Property Value
Type Description
int

Value

public ByteString Value { get; }

Gets the underlying byte string.

Property Value
Type Description
ByteString

Methods

Compare(BigtableByteString, BigtableByteString)

public static int Compare(BigtableByteString x, BigtableByteString y)

Compares two BigtableByteString values lexicographically.

Parameters
Name Description
x BigtableByteString

Left value to compare

y BigtableByteString

Right value to compare

Returns
Type Description
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
Name Description
other BigtableByteString

An object to compare with this instance.

Returns
Type Description
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
Name Description
obj object

An object to compare with this instance.

Returns
Type Description
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
Type Description
ArgumentException

obj is not the same type as this instance.

GetEnumerator()

public IEnumerator<byte> GetEnumerator()

Returns an enumerator that iterates through the collection.

Returns
Type Description
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
Type Description
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
Type Description
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
Name Description
x BigtableByteString

Left value to compare

y BigtableByteString

Right value to compare

Returns
Type Description
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
Name Description
value BigtableByteString

The BigtableByteString value to convert.

Returns
Type Description
ByteString

explicit operator byte[](BigtableByteString)

public static explicit operator byte[](BigtableByteString value)

Converts the BigtableByteString value to its underlying byte array.

Parameter
Name Description
value BigtableByteString

The BigtableByteString value to convert.

Returns
Type Description
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
Name Description
value BigtableByteString

The BigtableByteString value to convert.

Returns
Type Description
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
Name Description
value BigtableByteString

The BigtableByteString value to convert.

Returns
Type Description
string

operator >(BigtableByteString, BigtableByteString)

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

Operator overload to compare two BigtableByteString values.

Parameters
Name Description
x BigtableByteString

Left value to compare

y BigtableByteString

Right value to compare

Returns
Type Description
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
Name Description
x BigtableByteString

Left value to compare

y BigtableByteString

Right value to compare

Returns
Type Description
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
Name Description
value ByteString

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

Returns
Type Description
BigtableByteString

implicit operator BigtableByteString(byte[])

public static implicit operator BigtableByteString(byte[] value)

Converts a byte array to a BigtableByteString value.

Parameter
Name Description
value byte

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

Returns
Type Description
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
Name Description
value long

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

Returns
Type Description
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
Name Description
valueAsUtf8 string

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
Type Description
BigtableByteString

operator !=(BigtableByteString, BigtableByteString)

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

Operator overload to compare two BigtableByteString values for inequality.

Parameters
Name Description
x BigtableByteString

Left value to compare

y BigtableByteString

Right value to compare

Returns
Type Description
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
Name Description
x BigtableByteString

Left value to compare

y BigtableByteString

Right value to compare

Returns
Type Description
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
Name Description
x BigtableByteString

Left value to compare

y BigtableByteString

Right value to compare

Returns
Type Description
bool

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