Diffusion Apple API  6.9.0
Unified Client Library for iOS, tvOS and OS X / macOS
 All Classes Files Functions Variables Enumerations Enumerator Properties Pages
Class Methods | Properties | Instance Methods | List of all members
PTDiffusionRecordV2Schema Class Reference

Introduction

A schema.

A schema describes data value format in terms of one or more record definitions. A record definition describes the layout of a record and comprises one or more field definitions.

Within the data value there can be multiple occurrences of a record or field described by a single definition. The defined (or allowed, when describing variable numbers) number of occurrences of each definition is referred to as its 'multiplicity'. The multiplicity can be fixed (the item occurs a fixed number of times), or variable (the item occurs from a minimum number of times to a maximum number of times). If a variable field is used it must be the last in a record definition and if a variable record is used it must be the last in the schema definition.

A field may be defined as of type 'string', 'integer' or 'decimal'. A decimal type has a further property of 'scale' which defines the number of digits to the right of the decimal point.

See Also
PTDiffusionRecordV2SchemaBuilder
Since
6.0
Inheritance diagram for PTDiffusionRecordV2Schema:

Class Methods

(nullable instancetype) + schemaWithJSONData:error:
 

Properties

NSArray
< PTDiffusionRecordV2SchemaRecord * > * 
records
 

Instance Methods

(NSData *) - JSONData
 
(PTDiffusionMutableRecordV2Model *) - createMutableModel
 
(BOOL) - isEqualToRecordV2Schema:
 

Method Documentation

- (PTDiffusionMutableRecordV2Model *) createMutableModel

Create a mutable model based upon the schema.

The model will be created with all mandatory record occurrences and all mandatory field occurrences initialized to default values.

Such a model may be mutated and used to generate updated PTDiffusionRecordV2 instances for updating purposes.

Returns
a new initialized model.
Since
6.0
- (BOOL) isEqualToRecordV2Schema: (nullable PTDiffusionRecordV2Schema *)  schema

Compares the receiver to the given schema.

Parameters
schemaThe schema object with which to compare the receiver.
Returns
YES if the schema is equal to the contents of the receiver, otherwise NO.
Since
6.0
- (NSData *) JSONData

Returns the schema in a JSON format.

Returns
Schema in a JSON format.
Since
6.0
+ (nullable instancetype) schemaWithJSONData: (NSData *)  jsonData
error: (NSError **)  error 

Returns a schema object initialized from the given JSON definition.

Parameters
jsonDataEncoded JSON string representation of the schema.
errorIf this method returns nil to indicate that an error occurred then this will be populated with the reason for that failure.
Returns
An immutable schema derived from the JSON representation; or nil if an error occurred, in which case *error will be populated with the failure reason.
Since
6.0

Property Documentation

- (NSArray<PTDiffusionRecordV2SchemaRecord *>*) records
readnonatomicassign

An immutable, ordered list of record definitions.

There will be at least one.

Since
6.0