StringValue

open class StringValue: DataValue

DataValue subclass that wraps a value of type string.

  • A wrapped empty string value.

    Declaration

    Swift

    public static let empty: StringValue = StringValue.of("")
  • Compare two wrapped values for ordering.

    Declaration

    Swift

    open class func compare(_ left: StringValue, _ right: StringValue) -> Int

    Parameters

    left

    First object for comparison.

    right

    Second object for comparison.

    Return Value

    -1 if left.value < right.value, 0 if left.value == right.value, or 1 if left.value > right.value.

  • The type BasicType.STRING.

    Declaration

    Swift

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

    Declaration

    Swift

    open class func equal(_ left: StringValue?, _ right: StringValue?) -> Bool

    Parameters

    left

    First object for comparison.

    right

    Second object for comparison.

    Return Value

    true if left.value == right.value or if both arguments are nil, otherwise false.

  • Declaration

    Swift

    override open func equals(_ value: AnyObject?) -> Bool

    Parameters

    value

    The value to compare with.

    Return Value

    true if this object is equal to value.

  • Hash the wrapped value to a number.

    Declaration

    Swift

    override open func hashCode() -> Int

    Return Value

    Any value in the range of type int.

  • Wrap a string value as an object.

    Declaration

    Swift

    open class func of(_ value: String) -> StringValue

    Parameters

    value

    Value to be wrapped.

    Return Value

    The wrapped value.

  • Wrap a nullable string value as an object.

    Declaration

    Swift

    open class func of(optional value: String?) -> StringValue?

    Parameters

    value

    Value to be wrapped.

    Return Value

    The wrapped value.

  • Convert a wrapped string value to a nullable string.

    Throws

    CastException if value is not a wrapped string or nil.

    Declaration

    Swift

    open class func optional(_ value: AnyObject?) -> String?

    Parameters

    value

    The wrapped value.

    Return Value

    A nullable string.

  • 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.

  • Data type code of the wrapped value, equivalent to dataType.code.

    Declaration

    Swift

    override open var typeCode: Int
  • Convert a wrapped string value to a string.

    Throws

    CastException if value is not a wrapped string.

    Declaration

    Swift

    open class func unwrap(_ value: AnyObject?) -> String

    Parameters

    value

    The wrapped value.

    Return Value

    A string.

  • The wrapped value.

    Declaration

    Swift

    open var value: String