DataType
open class DataType : ObjectBase, @unchecked Sendable
Represents a data type defined by XML Schema Part 2: Datatypes or OData. String, binary, boolean, numeric and calendar types use XML Schema nomenclature. Geography, geometry, complex and entity types use OData nomenclature.
-
Constant type code for the
stringdata type.Declaration
Swift
public static let string: Int -
Constant type code for the
binarydata type.Declaration
Swift
public static let binary: Int -
Constant type code for the
booleandata type.Declaration
Swift
public static let boolean: Int -
Constant type code for the
chardata type.Declaration
Swift
public static let char: Int -
Constant type code for the
bytedata type.Declaration
Swift
public static let byte: Int -
Constant type code for the
shortdata type.Declaration
Swift
public static let short: Int -
Constant type code for the
intdata type.Declaration
Swift
public static let int: Int -
Constant type code for the
longdata type.Declaration
Swift
public static let long: Int -
Constant type code for the
integerdata type.Declaration
Swift
public static let integer: Int -
Constant type code for the
decimaldata type.Declaration
Swift
public static let decimal: Int -
Constant type code for the
floatdata type.Declaration
Swift
public static let float: Int -
Constant type code for the
doubledata type.Declaration
Swift
public static let double: Int -
Constant type code for the
unsignedBytedata type.Declaration
Swift
public static let unsignedByte: Int -
Constant type code for the
unsignedShortdata type.Declaration
Swift
public static let unsignedShort: Int -
Constant type code for the
unsignedIntdata type.Declaration
Swift
public static let unsignedInt: Int -
Constant type code for the
unsignedLongdata type.Declaration
Swift
public static let unsignedLong: Int -
Constant type code for the
GuidValuedata type.Declaration
Swift
public static let guidValue: Int -
Constant type code for the
LocalDatedata type.Declaration
Swift
public static let localDate: Int -
Constant type code for the
LocalTimedata type.Declaration
Swift
public static let localTime: Int -
Constant type code for the
LocalDateTimedata type.Declaration
Swift
public static let localDateTime: Int -
Constant type code for the
GlobalDateTimedata type.Declaration
Swift
public static let globalDateTime: Int -
Constant type code for the
DayTimeDurationdata type.Declaration
Swift
public static let dayTimeDuration: Int -
Constant type code for the
YearMonthDurationdata type.Declaration
Swift
public static let yearMonthDuration: Int -
Constant type code for the
GeographyValuedata type.Declaration
Swift
public static let geographyValue: Int -
Constant type code for the
GeographyPointdata type.Declaration
Swift
public static let geographyPoint: Int -
Constant type code for the
GeographyMultiPointdata type.Declaration
Swift
public static let geographyMultiPoint: Int -
Constant type code for the
GeographyLineStringdata type.Declaration
Swift
public static let geographyLineString: Int -
Constant type code for the
GeographyMultiLineStringdata type.Declaration
Swift
public static let geographyMultiLineString: Int -
Constant type code for the
GeographyPolygondata type.Declaration
Swift
public static let geographyPolygon: Int -
Constant type code for the
GeographyMultiPolygondata type.Declaration
Swift
public static let geographyMultiPolygon: Int -
Constant type code for the
GeographyCollectiondata type.Declaration
Swift
public static let geographyCollection: Int -
Constant type code for the
GeometryValuedata type.Declaration
Swift
public static let geometryValue: Int -
Constant type code for the
GeometryPointdata type.Declaration
Swift
public static let geometryPoint: Int -
Constant type code for the
GeometryMultiPointdata type.Declaration
Swift
public static let geometryMultiPoint: Int -
Constant type code for the
GeometryLineStringdata type.Declaration
Swift
public static let geometryLineString: Int -
Constant type code for the
GeometryMultiLineStringdata type.Declaration
Swift
public static let geometryMultiLineString: Int -
Constant type code for the
GeometryPolygondata type.Declaration
Swift
public static let geometryPolygon: Int -
Constant type code for the
GeometryMultiPolygondata type.Declaration
Swift
public static let geometryMultiPolygon: Int -
Constant type code for the
GeometryCollectiondata type.Declaration
Swift
public static let geometryCollection: Int -
Constant type code for the “Edm.PrimitiveType” data type.
Declaration
Swift
public static let edmPrimitive: Int -
Constant type code for the “Edm.Untyped” data type.
Declaration
Swift
public static let edmUntyped: Int -
Constant type code for the
DataValueabstract type.Declaration
Swift
public static let dataValue: Int -
Constant type code for the
ComplexValuedata type.Declaration
Swift
public static let complexValue: Int -
Constant type code for the
EntityValuedata type.Declaration
Swift
public static let entityValue: Int -
Constant type code for an enum type.
Declaration
Swift
public static let enumValue: Int -
Constant type code for the
ListBasetype.Declaration
Swift
public static let list: Int -
Constant type code for the
MapBasetype.Declaration
Swift
public static let map: Int -
Constant type code for the
SetBasetype.Declaration
Swift
public static let set: Int -
Constant type code for the
DataValueListdata type.Declaration
Swift
public static let dataValueList: Int -
Constant type code for the
ComplexValueListdata type.Declaration
Swift
public static let complexValueList: Int -
Constant type code for the
EntityValueListdata type.Declaration
Swift
public static let entityValueList: Int -
Constant type code for the
ByteStreamdata type.Declaration
Swift
public static let byteStream: Int -
Constant type code for the
CharStreamdata type.Declaration
Swift
public static let charStream: Int -
Constant type code for the
DeltaStreamdata type.Declaration
Swift
public static let deltaStream: Int -
Constant type code for the
StreamLinkdata type.Declaration
Swift
public static let streamLink: Int -
Constant type code for
DataPath.Declaration
Swift
public static let path: Int -
Constant type code for an OData CSDL
Pathexpression.Declaration
Swift
public static let pathExpression: Int -
Constant type code for an OData CSDL
AnnotationPath.Declaration
Swift
public static let annotationPath: Int -
Constant type code for an OData CSDL
PropertyPath.Declaration
Swift
public static let structuralPath: Int -
Constant type code for an OData CSDL
NavigationPropertyPath.Declaration
Swift
public static let navigationPath: Int -
Constant type code for an OData CSDL
AnyPropertyPath.Declaration
Swift
public static let propertyPath: Int -
Constant type code for a dynamic (structural or navigation) path.
Declaration
Swift
public static let dynamicPath: Int -
Constant type code for an OData CSDL
TargetPath.Declaration
Swift
public static let targetPath: Int -
Constant type code for
ResourcePath.Declaration
Swift
public static let resourcePath: Int -
Constant type code for
QueryAlias.Declaration
Swift
public static let queryAlias: Int -
Constant type code for
QueryFilter.Declaration
Swift
public static let queryFilter: Int -
Constant type code for
QueryFunctionCall.Declaration
Swift
public static let queryFunctionCall: Int -
Constant type code for
QueryOperatorCall.Declaration
Swift
public static let queryOperatorCall: Int -
Constant type code for
DataMethodCall.Declaration
Swift
public static let dataMethodCall: Int -
Constant type code for
JsonElement.Declaration
Swift
public static let jsonElement: Int -
Constant type code for
XmlElement.Declaration
Swift
public static let xmlElement: Int -
Constant type code for
SymbolicName.Declaration
Swift
public static let symbolicName: Int -
The
unknowntype.Declaration
Swift
public static let unknown: DataType -
Default initializer.
Declaration
Swift
override public init() -
Declaration
Swift
open func asEnumType() -> EnumTypeReturn Value
selfifisEnumistrue,EnumType.openSimple(this)ifisOpenEnumistrue, otherwise panic. -
If this type is a derived simple, complex, entity or enum type, then the base type. Otherwise throw an exception.
See also
isDerived.Declaration
Swift
open var baseType: DataType { get } -
A numeric code to represent this data type.
See also
constants.Declaration
Swift
open var code: Int { get } -
Throws
UndefinedExceptionif there is no basic type with the specified code.See also
constants.Declaration
Swift
open class func forCode(_ code: Int) -> DataTypeParameters
codeData type code.
Return Value
the data type for a basic type code.
-
Throws
UndefinedExceptionif there is no basic type with the specified name.See also
forCode.Declaration
Swift
open class func forName(_ name: String) -> DataTypeParameters
nameData type name. Note: for optimial performance, types should be looked up by code.
Return Value
the data type for a basic type name.
-
trueif this type is a basic type (not a complex, entity, list or stream type).Declaration
Swift
open var isBasic: Bool { get } -
trueif this type is a basic list type.Declaration
Swift
open var isBasicList: Bool { get } -
trueif this type is a binary type.Declaration
Swift
open var isBinary: Bool { get } -
trueif this type is a boolean type.Declaration
Swift
open var isBoolean: Bool { get } -
trueif this type is a calendar type. Calendar types are also basic types.See also
isBasicDeclaration
Swift
open var isCalendar: Bool { get } -
trueif this is a complex type.See also
ComplexType.Declaration
Swift
open var isComplex: Bool { get } -
trueif this is a complex list type.Declaration
Swift
open var isComplexList: Bool { get } -
trueif this type is a derived simple, complex, entity or enum type.Declaration
Swift
open var isDerived: Bool { get } -
trueif this is an entity type.See also
EntityType.Declaration
Swift
open var isEntity: Bool { get } -
trueif this is an entity list type.Declaration
Swift
open var isEntityList: Bool { get } -
trueif this type is an enum type.Declaration
Swift
open var isEnum: Bool { get } -
trueif this is an enum list type.Declaration
Swift
open var isEnumList: Bool { get } -
trueif this type is a geography type. Geography types are also basic types.See also
isBasicDeclaration
Swift
open var isGeography: Bool { get } -
trueif this type is a geometry type. Geometry types are also basic types.See also
isBasicDeclaration
Swift
open var isGeometry: Bool { get } -
trueif this type is a geospatial (geography/geometry) type. Geospatial types are also basic types.Declaration
Swift
open var isGeospatial: Bool { get } -
trueif this type is a GUID type.Declaration
Swift
open var isGuid: Bool { get } -
trueif this is a list type.See also
ListBase.Declaration
Swift
open var isList: Bool { get } -
trueif this type is a mutable type.Declaration
Swift
open var isMutable: Bool { get } -
trueif this type is a number type.Declaration
Swift
open var isNumber: Bool { get } -
trueif this type is an “open enumeration”, a specially annotated OData TypeDefinition which represents a non-exclusive list of valid values.See also
asEnumType,SimpleType.openSimple.Declaration
Swift
open var isOpenEnum: Bool { get } -
trueif this type is a path type.Declaration
Swift
open var isPath: Bool { get } -
trueif this is a stream type.Declaration
Swift
open var isStream: Bool { get } -
trueif this type is a string type.Declaration
Swift
open var isString: Bool { get } -
trueif this is a structure (complex or entity) type.See also
ComplexType.Declaration
Swift
open var isStructure: Bool { get } -
trueif this is a structure (complex or entity) list type.Declaration
Swift
open var isStructureList: Bool { get } -
trueif this type is an unsigned type.Declaration
Swift
open var isUnsigned: Bool { get } -
If this type is a list type, then the item type. Otherwise throw an exception.
See also
isList.Declaration
Swift
open var itemType: DataType { get } -
Declaration
Swift
open class func listOf(item: DataType) -> DataTypeParameters
itemThe item type.
Return Value
The data type for a list of the specified item type.
-
The name of this data type.
Declaration
Swift
open var name: String { get } -
Declaration
Swift
override open func toString() -> StringReturn Value
The name of this data type.