Skip to main content

A typed value for shard key computation. More…

Inherits IEquatable.

Public Member Functions

int AsInt ()
 Gets the value as a 32-bit integer.
 
long AsLong ()
 Gets the value as a 64-bit integer.
 
float AsFloat ()
 Gets the value as a 32-bit float.
 
double AsDouble ()
 Gets the value as a 64-bit double.
 
string? AsString ()
 Gets the value as a string.
 
bool AsBool ()
 Gets the value as a boolean.
 
bool TryGetInt (out int value)
 Tries to get the value as an integer.
 
bool TryGetLong (out long value)
 Tries to get the value as a long.
 
bool TryGetString (out string? value)
 Tries to get the value as a string.
 
bool Equals (ShardKeyValue other)
 
override bool Equals (object? obj)
 
override int GetHashCode ()
 
override string ToString ()
 

Static Public Member Functions

static ShardKeyValue Null ()
 Creates a null shard key value.
 
static ShardKeyValue Int (int value)
 Creates a 32-bit integer shard key value.
 
static ShardKeyValue Long (long value)
 Creates a 64-bit integer shard key value.
 
static ShardKeyValue Float (float value)
 Creates a 32-bit float shard key value.
 
static ShardKeyValue Double (double value)
 Creates a 64-bit double shard key value.
 
static ShardKeyValue String (string value)
 Creates a string shard key value.
 
static ShardKeyValue Date (string value)
 Creates a date shard key value (YYYY-MM-DD format).
 
static ShardKeyValue DateTime (string value)
 Creates a datetime shard key value (YYYY-MM-DD HH:MM:SS.mmm format).
 
static ShardKeyValue Time (string value)
 Creates a time shard key value (HH:MM:SS.mmm format).
 
static ShardKeyValue Ipv4 (string value)
 Creates an IPv4 shard key value (dotted-quad format).
 
static ShardKeyValue Decimal (string value)
 Creates a decimal shard key value (string representation).
 
static ShardKeyValue Boolean (bool value)
 Creates a boolean shard key value.
 
static ShardKeyValue Int8 (sbyte value)
 Creates an 8-bit integer shard key value.
 
static ShardKeyValue Int16 (short value)
 Creates a 16-bit integer shard key value.
 
static ShardKeyValue Timestamp (long value)
 Creates a timestamp shard key value (milliseconds since Unix epoch).
 
static ShardKeyValue Uuid (string value)
 Creates a UUID shard key value (standard format).
 
static ShardKeyValue Ulong (string value)
 Creates an unsigned long shard key value (string representation).
 
static bool operator== (ShardKeyValue left, ShardKeyValue right)
 Determines whether two ShardKeyValue instances are equal.
 
static bool operator!= (ShardKeyValue left, ShardKeyValue right)
 Determines whether two ShardKeyValue instances are not equal.
 

Properties

ShardKeyValueType Type [get]
 Gets the type of this shard key value.
 
bool IsNull [get]
 Returns true if this value is null.
 

Detailed Description

A typed value for shard key computation.

Equivalent to Rust’s ShardKeyValue enum.

This struct provides type-safe storage for shard key values without requiring boxing or string parsing at routing time.

Definition at line 55 of file ShardKeyValue.cs.

Member Function Documentation

◆ AsBool()

bool kinetica.Records.ShardKeyValue.AsBool ()
inline

Gets the value as a boolean.

Exceptions
InvalidOperationExceptionIf the value type is not Boolean.

Definition at line 203 of file ShardKeyValue.cs.

◆ AsDouble()

double kinetica.Records.ShardKeyValue.AsDouble ()
inline

Gets the value as a 64-bit double.

Exceptions
InvalidOperationExceptionIf the value type is not Double or Float.

Definition at line 175 of file ShardKeyValue.cs.

◆ AsFloat()

float kinetica.Records.ShardKeyValue.AsFloat ()
inline

Gets the value as a 32-bit float.

Exceptions
InvalidOperationExceptionIf the value type is not Float.

Definition at line 163 of file ShardKeyValue.cs.

◆ AsInt()

int kinetica.Records.ShardKeyValue.AsInt ()
inline

Gets the value as a 32-bit integer.

Exceptions
InvalidOperationExceptionIf the value type is not Int, Int8, Int16, or Boolean.

Definition at line 136 of file ShardKeyValue.cs.

◆ AsLong()

long kinetica.Records.ShardKeyValue.AsLong ()
inline

Gets the value as a 64-bit integer.

Exceptions
InvalidOperationExceptionIf the value type is not numeric.

Definition at line 149 of file ShardKeyValue.cs.

◆ AsString()

string? kinetica.Records.ShardKeyValue.AsString ()
inline

Gets the value as a string.

Exceptions
InvalidOperationExceptionIf the value type is not a string-based type.

Definition at line 187 of file ShardKeyValue.cs.

◆ Boolean()

static ShardKeyValue kinetica.Records.ShardKeyValue.Boolean (boolvalue)
static

Creates a boolean shard key value.

◆ Date()

static ShardKeyValue kinetica.Records.ShardKeyValue.Date (stringvalue)
static

Creates a date shard key value (YYYY-MM-DD format).

◆ DateTime()

static ShardKeyValue kinetica.Records.ShardKeyValue.DateTime (stringvalue)
static

Creates a datetime shard key value (YYYY-MM-DD HH:MM:SS.mmm format).

◆ Decimal()

static ShardKeyValue kinetica.Records.ShardKeyValue.Decimal (stringvalue)
static

Creates a decimal shard key value (string representation).

◆ Double()

static ShardKeyValue kinetica.Records.ShardKeyValue.Double (doublevalue)
static

Creates a 64-bit double shard key value.

◆ Equals() [1/2]

override bool kinetica.Records.ShardKeyValue.Equals (object?obj)

◆ Equals() [2/2]

bool kinetica.Records.ShardKeyValue.Equals (ShardKeyValueother)
inline

Definition at line 256 of file ShardKeyValue.cs.

◆ Float()

static ShardKeyValue kinetica.Records.ShardKeyValue.Float (floatvalue)
static

Creates a 32-bit float shard key value.

◆ GetHashCode()

override int kinetica.Records.ShardKeyValue.GetHashCode ()
inline

Definition at line 276 of file ShardKeyValue.cs.

◆ Int()

static ShardKeyValue kinetica.Records.ShardKeyValue.Int (intvalue)
static

Creates a 32-bit integer shard key value.

◆ Int16()

static ShardKeyValue kinetica.Records.ShardKeyValue.Int16 (shortvalue)
static

Creates a 16-bit integer shard key value.

◆ Int8()

static ShardKeyValue kinetica.Records.ShardKeyValue.Int8 (sbytevalue)
static

Creates an 8-bit integer shard key value.

◆ Ipv4()

static ShardKeyValue kinetica.Records.ShardKeyValue.Ipv4 (stringvalue)
static

Creates an IPv4 shard key value (dotted-quad format).

◆ Long()

static ShardKeyValue kinetica.Records.ShardKeyValue.Long (longvalue)
static

Creates a 64-bit integer shard key value.

◆ Null()

static ShardKeyValue kinetica.Records.ShardKeyValue.Null ()
static

Creates a null shard key value.

◆ operator!=()

static bool kinetica.Records.ShardKeyValue.operator!= (ShardKeyValueleft,
ShardKeyValueright )
static

Determines whether two ShardKeyValue instances are not equal.

◆ operator==()

static bool kinetica.Records.ShardKeyValue.operator== (ShardKeyValueleft,
ShardKeyValueright )
static

Determines whether two ShardKeyValue instances are equal.

◆ String()

static ShardKeyValue kinetica.Records.ShardKeyValue.String (stringvalue)
static

Creates a string shard key value.

◆ Time()

static ShardKeyValue kinetica.Records.ShardKeyValue.Time (stringvalue)
static

Creates a time shard key value (HH:MM:SS.mmm format).

◆ Timestamp()

static ShardKeyValue kinetica.Records.ShardKeyValue.Timestamp (longvalue)
static

Creates a timestamp shard key value (milliseconds since Unix epoch).

◆ ToString()

override string kinetica.Records.ShardKeyValue.ToString ()
inline

Definition at line 298 of file ShardKeyValue.cs.

◆ TryGetInt()

bool kinetica.Records.ShardKeyValue.TryGetInt (out intvalue)
inline

Tries to get the value as an integer.

Definition at line 213 of file ShardKeyValue.cs.

◆ TryGetLong()

bool kinetica.Records.ShardKeyValue.TryGetLong (out longvalue)
inline

Tries to get the value as a long.

Definition at line 225 of file ShardKeyValue.cs.

◆ TryGetString()

bool kinetica.Records.ShardKeyValue.TryGetString (out string?value)
inline

Tries to get the value as a string.

Definition at line 238 of file ShardKeyValue.cs.

◆ Ulong()

static ShardKeyValue kinetica.Records.ShardKeyValue.Ulong (stringvalue)
static

Creates an unsigned long shard key value (string representation).

◆ Uuid()

static ShardKeyValue kinetica.Records.ShardKeyValue.Uuid (stringvalue)
static

Creates a UUID shard key value (standard format).

Property Documentation

◆ IsNull

bool kinetica.Records.ShardKeyValue.IsNull
get

Returns true if this value is null.

Definition at line 74 of file ShardKeyValue.cs.

◆ Type

ShardKeyValueType kinetica.Records.ShardKeyValue.Type
get

Gets the type of this shard key value.

Definition at line 71 of file ShardKeyValue.cs.


The documentation for this struct was generated from the following file: