Guid

Overview

Represents a globally unique identifier (GUID). A GUID is a 128-bit integer (16 bytes) that can be used across all computers and networks wherever a unique identifier is required.

Note: On the .NET platfrom, byte representation of the Sugar.Guid is different from that in the System.Guid class

Location

  • Reference: Sugar
  • Namespace: Sugar
  • Ancestry: ValueType | Guid

 

constructor

Creates a new instance of the class whose value is all zeros.

 

constructor

 

Guid()

 

init()

 

Guid()

 

Sub New()

constructor (array of Byte)

Creates a new instance of the class by using the specified array of bytes.

 

constructor(Value: array of Byte)

 

Guid(Byte[] Value)

 

init(_ Value: Byte...)

 

Guid(Byte[] Value)

 

Sub New(Value As Byte())

Parameters:

  • Value: A 16-element byte array containing values that will be used to initialize Guid.

CompareTo  mapped

Compares this instance to a specified Guid object and returns an indication of their relative values.

 

method CompareTo(Value: Guid): Int32

 

Int32 CompareTo(Guid Value)

 

func CompareTo(_ Value: Guid) -> Int32

 

Int32 CompareTo(Guid Value)

 

Function CompareTo(Value As Guid) As Int32

Parameters:

  • Value: An object to compare to this instance.

Empty

 

class method Empty: Guid

 

static Guid Empty()

 

static func Empty() -> Guid

 

static Guid Empty()

 

Shared Function Empty() As Guid

EmptyGuid

Creates an instance of the Guid whose value is all zeros.

 

class method EmptyGuid: Guid

 

static Guid EmptyGuid()

 

static func EmptyGuid() -> Guid

 

static Guid EmptyGuid()

 

Shared Function EmptyGuid() As Guid

Equals  mapped

Returns a value indicating whether this instance and a specified Guid object represent the same value.

 

method Equals(Value: Guid): Boolean

 

Boolean Equals(Guid Value)

 

func Equals(_ Value: Guid) -> Boolean

 

Boolean Equals(Guid Value)

 

Function Equals(Value As Guid) As Boolean

Parameters:

  • Value: An object to compare to this instance.

NewGuid

Initializes a new instance of the Guid with random data.

 

class method NewGuid: Guid

 

static Guid NewGuid()

 

static func NewGuid() -> Guid

 

static Guid NewGuid()

 

Shared Function NewGuid() As Guid

Parse

Converts the string representation of a GUID to the equivalent class

 

class method Parse(Value: String): Guid

 

static Guid Parse(String Value)

 

static func Parse(_ Value: String) -> Guid

 

static Guid Parse(String Value)

 

Shared Function Parse(Value As String) As Guid

Parameters:

  • Value: The string representation of GUID to convert.

ToByteArray  mapped

Returns a 16-element byte array that contains the value of this instance.

 

method ToByteArray: array of Byte

 

Byte[] ToByteArray()

 

func ToByteArray() -> Byte...

 

Byte[] ToByteArray()

 

Function ToByteArray() As Byte()

ToString  mapped

Returns a string representation of the value of this Guid instance with default format. Returns same value as call to ToString(GuidFormat.Default).

 

method ToString: String

 

String ToString()

 

func ToString() -> String

 

String ToString()

 

Function ToString() As String

ToString (GuidFormat): String  mapped

Returns a string representation of the value of this Guid instance, according to the provided format specifier.

 

method ToString(Format: GuidFormat): String

 

String ToString(GuidFormat Format)

 

func ToString(_ Format: GuidFormat) -> String

 

String ToString(GuidFormat Format)

 

Function ToString(Format As GuidFormat) As String

Parameters:

  • Format: Format specifier that indicates how to format the value of this Guid.

 

Empty

 

class method Empty: Guid

 

static Guid Empty()

 

static func Empty() -> Guid

 

static Guid Empty()

 

Shared Function Empty() As Guid

EmptyGuid

Creates an instance of the Guid whose value is all zeros.

 

class method EmptyGuid: Guid

 

static Guid EmptyGuid()

 

static func EmptyGuid() -> Guid

 

static Guid EmptyGuid()

 

Shared Function EmptyGuid() As Guid

NewGuid

Initializes a new instance of the Guid with random data.

 

class method NewGuid: Guid

 

static Guid NewGuid()

 

static func NewGuid() -> Guid

 

static Guid NewGuid()

 

Shared Function NewGuid() As Guid

Parse

Converts the string representation of a GUID to the equivalent class

 

class method Parse(Value: String): Guid

 

static Guid Parse(String Value)

 

static func Parse(_ Value: String) -> Guid

 

static Guid Parse(String Value)

 

Shared Function Parse(Value As String) As Guid

Parameters:

  • Value: The string representation of GUID to convert.

 

constructor

Creates a new instance of the class whose value is all zeros.

 

constructor

 

Guid()

 

init()

 

Guid()

 

Sub New()

constructor (array of Byte)

Creates a new instance of the class by using the specified array of bytes.

 

constructor(Value: array of Byte)

 

Guid(Byte[] Value)

 

init(_ Value: Byte...)

 

Guid(Byte[] Value)

 

Sub New(Value As Byte())

Parameters:

  • Value: A 16-element byte array containing values that will be used to initialize Guid.

CompareTo  mapped

Compares this instance to a specified Guid object and returns an indication of their relative values.

 

method CompareTo(Value: Guid): Int32

 

Int32 CompareTo(Guid Value)

 

func CompareTo(_ Value: Guid) -> Int32

 

Int32 CompareTo(Guid Value)

 

Function CompareTo(Value As Guid) As Int32

Parameters:

  • Value: An object to compare to this instance.

Equals  mapped

Returns a value indicating whether this instance and a specified Guid object represent the same value.

 

method Equals(Value: Guid): Boolean

 

Boolean Equals(Guid Value)

 

func Equals(_ Value: Guid) -> Boolean

 

Boolean Equals(Guid Value)

 

Function Equals(Value As Guid) As Boolean

Parameters:

  • Value: An object to compare to this instance.

ToByteArray  mapped

Returns a 16-element byte array that contains the value of this instance.

 

method ToByteArray: array of Byte

 

Byte[] ToByteArray()

 

func ToByteArray() -> Byte...

 

Byte[] ToByteArray()

 

Function ToByteArray() As Byte()

ToString  mapped

Returns a string representation of the value of this Guid instance with default format. Returns same value as call to ToString(GuidFormat.Default).

 

method ToString: String

 

String ToString()

 

func ToString() -> String

 

String ToString()

 

Function ToString() As String

ToString (GuidFormat): String  mapped

Returns a string representation of the value of this Guid instance, according to the provided format specifier.

 

method ToString(Format: GuidFormat): String

 

String ToString(GuidFormat Format)

 

func ToString(_ Format: GuidFormat) -> String

 

String ToString(GuidFormat Format)

 

Function ToString(Format As GuidFormat) As String

Parameters:

  • Format: Format specifier that indicates how to format the value of this Guid.