EnumValue
open class EnumValue : DataValue
Encapsulates an OData enum value.
-
Can this model element be removed by
DataService.refreshMetadata
. Defaults tofalse
. Set this totrue
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
-
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
-
True if this member was added since metadata was originally loaded.
Declaration
Swift
final public var isExtension: Bool
-
Source line number for this schema element within its defining schema.
Declaration
Swift
final public var sourceLine: Int
-
Lookup an existing annotation by term name, or throw an exception if the annotation is not found.
Declaration
Swift
open func annotation(withName term: String) -> Annotation
Parameters
term
The term name.
Return Value
The annotation.
-
Obsolete. Use
annotations
.Declaration
Swift
open var annotationList: AnnotationList { get }
-
Obsolete. Use
annotations
.Declaration
Swift
open var annotationMap: AnnotationMap { get }
-
Map of annotations for this model element. For annotations without qualifiers, the entry key is the annotation term name. For annotations with qualifiers, the entry key is the annotation term name, then “#”, then the annotation qualifier.
Declaration
Swift
open var annotations: AnnotationMap { get }
-
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 ifx.value == y.value
, or 1 ifx.value > y.value
. -
Declaration
Swift
override open func copyMutable() -> DataValue
Return Value
A clone of this value if it (together with all value subcomponents) is possibly mutable, or return
self
value if it (together with all value subcomponents) is definitely immutable. The resulting value might share mutable metadata with this query. -
Data type with a
DataType.code
ofDataType.ENUM_VALUE
.Declaration
Swift
override open var dataType: DataType { get }
-
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
ifx.value == y.value
or if both arguments arenil
, otherwisefalse
. -
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 { get }
-
Declaration
Swift
open func shortValue() -> Int
Return Value
The numeric value of this enum value as a short.
-
Declaration
Swift
open func stringValue() -> String
Return Value
This enum value as a 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.
-
The numeric value of this enum value as a ByteValue, ShortValue, IntValue, LongValue, UnsignedByte, UnsignedShort or StringValue (depending on the enum type’s underlying type).
Declaration
Swift
open var value: DataValue { get }