DataType

open class DataType : ObjectBase

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 string data type.

    Declaration

    Swift

    public static let string: Int
  • Constant type code for the binary data type.

    Declaration

    Swift

    public static let binary: Int
  • Constant type code for the boolean data type.

    Declaration

    Swift

    public static let boolean: Int
  • Constant type code for the char data type.

    Declaration

    Swift

    public static let char: Int
  • Constant type code for the byte data type.

    Declaration

    Swift

    public static let byte: Int
  • Constant type code for the short data type.

    Declaration

    Swift

    public static let short: Int
  • int

    Constant type code for the int data type.

    Declaration

    Swift

    public static let int: Int
  • Constant type code for the long data type.

    Declaration

    Swift

    public static let long: Int
  • Constant type code for the integer data type.

    Declaration

    Swift

    public static let integer: Int
  • Constant type code for the decimal data type.

    Declaration

    Swift

    public static let decimal: Int
  • Constant type code for the float data type.

    Declaration

    Swift

    public static let float: Int
  • Constant type code for the double data type.

    Declaration

    Swift

    public static let double: Int
  • Constant type code for the unsignedByte data type.

    Declaration

    Swift

    public static let unsignedByte: Int
  • Constant type code for the unsignedShort data type.

    Declaration

    Swift

    public static let unsignedShort: Int
  • Constant type code for the unsignedInt data type.

    Declaration

    Swift

    public static let unsignedInt: Int
  • Constant type code for the unsignedLong data type.

    Declaration

    Swift

    public static let unsignedLong: Int
  • Constant type code for an enum type.

    Declaration

    Swift

    public static let enumValue: Int
  • Constant type code for the GuidValue data type.

    Declaration

    Swift

    public static let guidValue: Int
  • Constant type code for the ByteStream data type.

    Declaration

    Swift

    public static let byteStream: Int
  • Constant type code for the CharStream data type.

    Declaration

    Swift

    public static let charStream: Int
  • Constant type code for the StreamLink data type.

    Declaration

    Swift

    public static let streamLink: Int
  • Constant type code for the LocalDate data type.

    Declaration

    Swift

    public static let localDate: Int
  • Constant type code for the LocalTime data type.

    Declaration

    Swift

    public static let localTime: Int
  • Constant type code for the LocalDateTime data type.

    Declaration

    Swift

    public static let localDateTime: Int
  • Constant type code for the GlobalDateTime data type.

    Declaration

    Swift

    public static let globalDateTime: Int
  • Constant type code for the DayTimeDuration data type.

    Declaration

    Swift

    public static let dayTimeDuration: Int
  • Constant type code for the YearMonthDuration data type.

    Declaration

    Swift

    public static let yearMonthDuration: Int
  • Constant type code for the GeographyValue data type.

    Declaration

    Swift

    public static let geographyValue: Int
  • Constant type code for the GeographyPoint data type.

    Declaration

    Swift

    public static let geographyPoint: Int
  • Constant type code for the GeographyMultiPoint data type.

    Declaration

    Swift

    public static let geographyMultiPoint: Int
  • Constant type code for the GeographyLineString data type.

    Declaration

    Swift

    public static let geographyLineString: Int
  • Constant type code for the GeographyMultiLineString data type.

    Declaration

    Swift

    public static let geographyMultiLineString: Int
  • Constant type code for the GeographyPolygon data type.

    Declaration

    Swift

    public static let geographyPolygon: Int
  • Constant type code for the GeographyMultiPolygon data type.

    Declaration

    Swift

    public static let geographyMultiPolygon: Int
  • Constant type code for the GeographyCollection data type.

    Declaration

    Swift

    public static let geographyCollection: Int
  • Constant type code for the GeometryValue data type.

    Declaration

    Swift

    public static let geometryValue: Int
  • Constant type code for the GeometryPoint data type.

    Declaration

    Swift

    public static let geometryPoint: Int
  • Constant type code for the GeometryMultiPoint data type.

    Declaration

    Swift

    public static let geometryMultiPoint: Int
  • Constant type code for the GeometryLineString data type.

    Declaration

    Swift

    public static let geometryLineString: Int
  • Constant type code for the GeometryMultiLineString data type.

    Declaration

    Swift

    public static let geometryMultiLineString: Int
  • Constant type code for the GeometryPolygon data type.

    Declaration

    Swift

    public static let geometryPolygon: Int
  • Constant type code for the GeometryMultiPolygon data type.

    Declaration

    Swift

    public static let geometryMultiPolygon: Int
  • Constant type code for the GeometryCollection data type.

    Declaration

    Swift

    public static let geometryCollection: Int
  • Constant type code for the “Edm.PrimitiveType” abstract data type.

    Declaration

    Swift

    public static let edmPrimitive: Int
  • Constant type code for the object data type.

    Declaration

    Swift

    public static let object: Int
  • Constant type code for the ComplexValue data type.

    Declaration

    Swift

    public static let complexValue: Int
  • Constant type code for the EntityValue data type.

    Declaration

    Swift

    public static let entityValue: Int
  • Constant type code for the ListBase data type.

    Declaration

    Swift

    public static let list: Int
  • Constant type code for the DataValueList data type.

    Declaration

    Swift

    public static let dataValueList: Int
  • Constant type code for the ComplexValueList data type.

    Declaration

    Swift

    public static let complexValueList: Int
  • Constant type code for the EntityValueList data type.

    Declaration

    Swift

    public static let entityValueList: Int
  • Constant type code for the DeltaStream data type.

    Declaration

    Swift

    public static let deltaStream: Int
  • Constant type code for the “Edm.PrimitiveType” abstract data type.

    Declaration

    Swift

    public static let edmUntyped: Int
  • Constant type code for DataPath.

    Declaration

    Swift

    public static let path: Int
  • Constant type code for an OData CSDL Path expression.

    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 an OData CSDL TargetPath.

    Declaration

    Swift

    public static let targetPath: Int
  • Constant type code for a dynamic (structural or navigation) path.

    Declaration

    Swift

    public static let dynamicPath: 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
  • The unknown type.

    Declaration

    Swift

    public static let unknown: DataType
  • Default initializer.

    Declaration

    Swift

    override public init()
  • 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

    UndefinedException if there is no basic type with the specified code.

    See also

    constants.

    Declaration

    Swift

    open class func forCode(_ code: Int) -> DataType

    Parameters

    code

    Data type code.

    Return Value

    the data type for a basic type code.

  • Throws

    UndefinedException if there is no basic type with the specified name.

    See also

    forCode.

    Declaration

    Swift

    open class func forName(_ name: String) -> DataType

    Parameters

    name

    Data type name. Note: for optimial performance, types should be looked up by code.

    Return Value

    the data type for a basic type name.

  • true if this type is a basic type (not a complex, entity, list or stream type).

    Declaration

    Swift

    open var isBasic: Bool { get }
  • true if this type is a basic list type.

    Declaration

    Swift

    open var isBasicList: Bool { get }
  • true if this type is a binary type.

    Declaration

    Swift

    open var isBinary: Bool { get }
  • true if this type is a boolean type.

    Declaration

    Swift

    open var isBoolean: Bool { get }
  • true if this type is a calendar type. Calendar types are also basic types.

    See also

    isBasic

    Declaration

    Swift

    open var isCalendar: Bool { get }
  • true if this is a complex type.

    See also

    ComplexType.

    Declaration

    Swift

    open var isComplex: Bool { get }
  • true if this is a complex list type.

    Declaration

    Swift

    open var isComplexList: Bool { get }
  • true if this type is a derived simple, complex, entity or enum type.

    Declaration

    Swift

    open var isDerived: Bool { get }
  • true if this is an entity type.

    See also

    EntityType.

    Declaration

    Swift

    open var isEntity: Bool { get }
  • true if this is an entity list type.

    Declaration

    Swift

    open var isEntityList: Bool { get }
  • true if this type is an enum type.

    Declaration

    Swift

    open var isEnum: Bool { get }
  • true if this is an enum list type.

    Declaration

    Swift

    open var isEnumList: Bool { get }
  • true if this type is a geography type. Geography types are also basic types.

    See also

    isBasic

    Declaration

    Swift

    open var isGeography: Bool { get }
  • true if this type is a geometry type. Geometry types are also basic types.

    See also

    isBasic

    Declaration

    Swift

    open var isGeometry: Bool { get }
  • true if this type is a geospatial (geography/geometry) type. Geospatial types are also basic types.

    Declaration

    Swift

    open var isGeospatial: Bool { get }
  • true if this type is a GUID type.

    Declaration

    Swift

    open var isGuid: Bool { get }
  • true if this is a list type.

    See also

    ListBase.

    Declaration

    Swift

    open var isList: Bool { get }
  • true if this type is a mutable type.

    Declaration

    Swift

    open var isMutable: Bool { get }
  • true if this type is a number type.

    Declaration

    Swift

    open var isNumber: Bool { get }
  • true if this type is a path type.

    Declaration

    Swift

    open var isPath: Bool { get }
  • true if this is a stream type.

    See also

    ByteStream, CharStream.

    Declaration

    Swift

    open var isStream: Bool { get }
  • true if this type is a string type.

    Declaration

    Swift

    open var isString: Bool { get }
  • true if 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) -> DataType

    Parameters

    item

    The 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() -> String

    Return Value

    The name of this data type.