GuidValue

open class GuidValue : DataValue

Encapsulates an OData GUID value.

  • Compare two wrapped values for ordering.

    Declaration

    Swift

    open class func compare(x: GuidValue, y: GuidValue) -> Int

    Parameters

    x

    First object for comparison.

    y

    Second object for comparison.

    Return Value

    -1 if x.value < y.value, 0 if x.value == y.value, or 1 if x.value > y.value.

  • The type BasicType.GUID_VALUE.

    Declaration

    Swift

    override open var dataType: DataType { get }
  • Compare two wrapped values for equality.

    Declaration

    Swift

    open class func equal(x: GuidValue?, y: GuidValue?) -> Bool

    Parameters

    x

    First object for comparison.

    y

    Second object for comparison.

    Return Value

    true if x.value == y.value or if both arguments are nil, otherwise false.

  • Wrap a GUID value as a GuidValue.

    Declaration

    Swift

    open class func of(_ value: GUID) -> GuidValue

    Parameters

    value

    Value to be wrapped.

    Return Value

    The wrapped value.

  • Wrap a GUID value as a GuidValue.

    Declaration

    Swift

    open class func ofOptional(_ value: GUID?) -> GuidValue?

    Parameters

    value

    Value to be wrapped.

    Return Value

    The wrapped value.

  • Parse a string (32/36-character GUID format) to a GuidValue.

    Declaration

    Swift

    open class func parse(_ value: String) -> GuidValue?

    Parameters

    value

    Value to be parsed.

    Return Value

    The wrapped value.

  • Declaration

    Swift

    open class func random() -> GuidValue

    Return Value

    A new random (Version 4) GuidValue.

  • Convert the wrapped value to binary format (16 bytes).

    Declaration

    Swift

    open func toBinary() -> Data

    Return Value

    16-byte GUID format of value.

  • Convert this data value to a string. If the dataType is defined by XML Schema Part 2: Datatypes, then the corresponding lexical format is used. JSON format is used for structured values (arrays and objects).

    Declaration

    Swift

    override open func toString() -> String

    Return Value

    Lexical representation of this data value.

  • Convert the wrapped value to the 32-character GUID format, e.g. “21ec20203aea1069a2dd08002b30309d”.

    Declaration

    Swift

    open func toString32() -> String

    Return Value

    32-character GUID format of value.

  • Convert the wrapped value to the 36-character GUID format, e.g. “21ec2020-3aea-1069-a2dd-08002b30309d”.

    Declaration

    Swift

    open func toString36() -> String

    Return Value

    36-character GUID format of value.

  • The wrapped value.

    Declaration

    Swift

    public final var value: GUID { get }