EnumValue

open class EnumValue: DataValue

Encapsulates an OData enum value.

  • Can this model element be removed by DataService.refreshMetadata. Defaults to false. Set this to true to indicate that the application is coded to be able able to function correctly without this model element.

    See also

    isRemoved.

    Declaration

    Swift

    final public var canBeRemoved: Bool = false
  • Has this model element been removed by a successful call to DataService.refreshMetadata? If `isRemoved == true, that implies that the old metadata (before refreshMetadata was called) did include this model element, and that the new metadata (after refreshMetadata was called) does not include this model element.

    See also

    canBeRemoved.

    Declaration

    Swift

    final public var isRemoved: Bool = false
  • True if this member was added since metadata was originally loaded.

    Declaration

    Swift

    final public var isExtension: Bool = false
  • List of annotations for this value.

    Declaration

    Swift

    final public var annotationList: AnnotationList = AnnotationList.empty
  • Map of annotations for this value.

    Declaration

    Swift

    final public var annotationMap: AnnotationMap = AnnotationMap.empty
  • Lookup an existing member annotation by term name.

    See also

    annotationMap, for looking up annotations that might not exist.

    Declaration

    Swift

    open func annotation(withName term: String) -> Annotation

    Parameters

    term

    The term name.

    Return Value

    The member annotation.

  • Declaration

    Swift

    open func byteValue() -> Int

    Return Value

    The numeric value of this enum value as a byte.

  • Compare two wrapped values for ordering.

    Declaration

    Swift

    open class func compare(x: EnumValue, y: EnumValue) -> 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.

  • Data type with a DataType.code of DataType.ENUM_VALUE.

    Declaration

    Swift

    override open var dataType: DataType
  • The enum type metadata for this value (dataType cast to EnumType).

    Declaration

    Swift

    open var enumType: EnumType
  • Compare two wrapped values for equality.

    Declaration

    Swift

    open class func equal(x: EnumValue?, y: EnumValue?) -> 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.

  • Declaration

    Swift

    open func intValue() -> Int

    Return Value

    The numeric value of this enum value as an int.

  • Declaration

    Swift

    open func longValue() -> Int64

    Return Value

    The numeric value of this enum value as a long.

  • Name of this enumeration member.

    Declaration

    Swift

    open var name: String
  • Declaration

    Swift

    open func shortValue() -> Int

    Return Value

    The numeric value of this enum value as a short.

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

  • The numeric value of this enum value as a ByteValue, ShortValue, IntValue, LongValue, UnsignedByte or UnsignedShort (depending on the enum type’s underlying type).

    Declaration

    Swift

    open var value: DataValue