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

Introduction

A constraint requiring the current value of a JSON topic to match the partially described value.

The Swift code:

let constraint = try PTDiffusionUpdateConstraint
    .jsonValue()
    .withStringValue(idValue, atPointer: "/id")
    .without("/cancellation")

creates a constraint for a JSON object with a specific ID value and no value for a "cancellation" property.

Missing keys are matched differently to keys that are present with null values.

Since
6.3
Inheritance diagram for PTDiffusionPartialJSONUpdateConstraint:
PTDiffusionUpdateConstraint

Instance Methods

(nullable instancetype) - withNullAt:error:
 
(nullable instancetype) - without:error:
 
(nullable instancetype) - withDoubleValue:atPointer:error:
 
(nullable instancetype) - withDoubleFloatNumberValue:atPointer:error:
 
(nullable instancetype) - withLongLongValue:atPointer:error:
 
(nullable instancetype) - withInt64NumberValue:atPointer:error:
 
(nullable instancetype) - withStringValue:atPointer:error:
 
- Instance Methods inherited from PTDiffusionUpdateConstraint
(nullable instancetype) - andConstraint:error:
 

Additional Inherited Members

- Class Methods inherited from PTDiffusionUpdateConstraint
(instancetype) + lockedWithLock:
 
(instancetype) + noValue
 
(instancetype) + noTopic
 
(PTDiffusionPartialJSONUpdateConstraint *) + jsonValue
 

Method Documentation

- (nullable instancetype) withDoubleFloatNumberValue: (NSNumber *)  number
atPointer: (NSString *)  pointer
error: (NSError **)  error 

Require a double-precision floating point (Eight-byte IEEE 754) number value at a specific position in the JSON object.

Parameters
numberThe value expected at the location referenced by pointer.
pointerA JSON Pointer syntax reference locating the value in the JSON object.
errorLocation to store a reason in case of failure. May be nil.
Returns
Primitive instance initialized with the given number value at the given specific position in the JSON object.
Exceptions
NSInvalidArgumentExceptionIf number or pointer is nil.
Note
To match a JSON null at the referenced location use withNullAt:error:
Since
6.3

Provided by category PTDiffusionPartialJSONUpdateConstraint(PTDiffusionPrimitive).

- (nullable instancetype) withDoubleValue: (double)  value
atPointer: (NSString *)  pointer
error: (NSError **)  error 

Require a double-precision floating point (Eight-byte IEEE 754) value at a specific position in the JSON object.

Parameters
valueThe value expected at the location referenced by pointer.
pointerA JSON Pointer syntax reference locating the value in the JSON object.
errorLocation to store a reason in case of failure. May be nil.
Returns
Primitive instance initialized with the given double value at the given specific position in the JSON object.
Exceptions
NSInvalidArgumentExceptionIf pointer is nil.
Since
6.3

Provided by category PTDiffusionPartialJSONUpdateConstraint(PTDiffusionPrimitive).

- (nullable instancetype) withInt64NumberValue: (NSNumber *)  number
atPointer: (NSString *)  pointer
error: (NSError **)  error 

Require a 64-bit integer number value at a specific position in the JSON object.

Parameters
numberThe value expected at the location referenced by pointer.
pointerA JSON Pointer syntax reference locating the value in the JSON object.
errorLocation to store a reason in case of failure. May be nil.
Returns
Primitive instance initialized with the given 64-bit number value at the given specific position in the JSON object.
Exceptions
NSInvalidArgumentExceptionIf number or pointer is nil.
Note
To match a JSON null at the referenced location use withNullAt:error:
Since
6.3

Provided by category PTDiffusionPartialJSONUpdateConstraint(PTDiffusionPrimitive).

- (nullable instancetype) withLongLongValue: (long long)  value
atPointer: (NSString *)  pointer
error: (NSError **)  error 

Require a 64-bit integer value at a specific position in the JSON object.

Parameters
valueThe value expected at the location referenced by pointer.
pointerA JSON Pointer syntax reference locating the value in the JSON object.
errorLocation to store a reason in case of failure. May be nil.
Returns
Primitive instance initialized with the given long value at the given specific position in the JSON object.
Exceptions
NSInvalidArgumentExceptionIf pointer is nil.
Since
6.3

Provided by category PTDiffusionPartialJSONUpdateConstraint(PTDiffusionPrimitive).

- (nullable instancetype) withNullAt: (NSString *)  pointer
error: (NSError **)  error 

Require a null value at a specific position in the JSON object.

Parameters
pointerA JSON Pointer syntax reference locating the null value in the JSON object.
errorLocation to store a reason in case of failure. May be nil.
Returns
A new constraint or nil if there was an error.
Exceptions
NSInvalidArgumentExceptionIf pointer is nil.
Since
6.3
- (nullable instancetype) without: (NSString *)  pointer
error: (NSError **)  error 

Require a specific position in the JSON object to be absent. This does not match positions that have null values.

Parameters
pointerA JSON Pointer syntax reference that should have no value in the JSON object.
errorLocation to store a reason in case of failure. May be nil.
Returns
A new constraint or nil if there was an error.
Exceptions
NSInvalidArgumentExceptionIf the pointer argument is nil.
Since
6.3
- (nullable instancetype) withStringValue: (NSString *)  string
atPointer: (NSString *)  pointer
error: (NSError **)  error 

Require a string value at a specific position in the JSON object.

Parameters
stringThe value expected at the location referenced by pointer.
pointerA JSON Pointer syntax reference locating the value in the JSON object.
errorLocation to store a reason in case of failure. May be nil.
Returns
Primitive instance initialized with the given string value at the given specific position in the JSON object.
Exceptions
NSInvalidArgumentExceptionIf string or pointer is nil.
Note
To match a JSON null at the referenced location use withNullAt:error:
Since
6.3

Provided by category PTDiffusionPartialJSONUpdateConstraint(PTDiffusionPrimitive).