• BlackBerry Dynamics
  • Runtime library for iOS applications
  • 12.0.1.79
GDVersion Class Reference

BlackBerry Dynamics entitlement version. More...

#import <BlackBerryDynamics/GD/GDVersion.h>

Inheritance diagram for GDVersion:

Description

Objects of this class are used to represent BlackBerry Dynamics entitlement versions.

BlackBerry Dynamics entitlement versions are sequences of numbers. The first number is the major version number and is the most significant. Numbers later in the sequence are of decreasing significance. By convention, there are four numbers in an entitlement version.

In the BlackBerry Dynamics management console, and in other administrative user interfaces, entitlement versions are represented by "dotted string" values, in which the numbers are separated by full stops (periods).

Objects of this class are used in the getEntitlementVersionsFor: (GDiOS) results list.

Interface Usage

#import <GD/GDVersion.h>
// Initialize from dotted string representation.
GDVersion *gdVersionA = [[GDVersion alloc] initWithString:@"1.2.0.3"];
NSUInteger length = [gdVersionA numberOfVersionParts];
// length == 4
NSUInteger majorVersion = [gdVersionA versionPartAt:0];
// majorVersion == 1
// Initialize from array of numbers.
GDVersion *gdVersionB = [[GDVersion alloc] initWithArray:@[1, 3] ];
length = [gdVersionB numberOfVersionParts];
// length == 2
NSInteger comparison = [gdVersionA compare:gdVersionB];
// comparison == NSOrderedAscending
comparison = [gdVersionB compare:gdVersionA];
// comparison == NSOrderedDescending
GDVersion *gdVersionC = [[GDVersion alloc] initWithString:@"1.3"];
comparison = [gdVersionB compare:gdVersionC];
// comparison == NSOrderedSame
BOOL isOrder = [gdVersionA isEqualToVersion:gdVersionB];
// isOrder == NO
isOrder = [gdVersionA isGreaterThanVersion:gdVersionB];
// isOrder == NO
isOrder = [gdVersionA isLessThanVersion:gdVersionB];
// isOrder == YES
NSString *dottedString = [gdVersionB stringValue];
// [dottedString isEqualToString:@"1.3"] == YES

The code snippet above illustrates the programming interface.

Instance Methods

(nullable instancetype) - initWithString:
 Initialize from a dotted string representation. More...
 
(nullable instancetype) - initWithArray:
 Initialize from an array of NSNumber objects. More...
 
(NSUInteger) - numberOfVersionParts
 Count of how many constituent numbers are in the version. More...
 
(NSUInteger) - versionPartAt:
 Get one constituent version number. More...
 
(NSComparisonResult) - compare:
 Compare this version with another version. More...
 
(BOOL) - isEqualToVersion:
 Check for equality with another version. More...
 
(BOOL) - isGreaterThanVersion:
 Check whether this version is more than another version. More...
 
(BOOL) - isLessThanVersion:
 Check whether this version is less than another version. More...
 

Properties

NSString * stringValue
 Dotted string representation. More...
 

Method Documentation

◆ initWithString:

- (nullable instancetype) initWithString: (NSString *)  versionString
Returns
GDVersion object with constituent version numbers read from a dotted string representation.

◆ initWithArray:

- (nullable instancetype) initWithArray: (NSArray *)  array
Returns
GDVersion object with constituent version numbers initialized from an array of NSNumber objects.

◆ numberOfVersionParts

- (NSUInteger) numberOfVersionParts
Returns
NSUInteger representation of the count of how many constituent numbers there are in the version.

◆ versionPartAt:

- (NSUInteger) versionPartAt: (NSUInteger)  position

Call this function to get one of the constituent numbers in the version, specified by a numeric position. Position zero is the major version number, which is the most significant.

Returns
The constituent version number at the specified position.

◆ compare:

- (NSComparisonResult) compare: (GDVersion *)  anotherVersion
Returns
NSComparisonResult representing the relative value of this version compared to the other version.

◆ isEqualToVersion:

- (BOOL) isEqualToVersion: (nullable GDVersion *)  anotherVersion
Returns
YES if the two versions are the same.
NO Otherwise.

◆ isGreaterThanVersion:

- (BOOL) isGreaterThanVersion: (nullable GDVersion *)  anotherVersion
Returns
YES if this version is more than the specified version.
NO Otherwise.

◆ isLessThanVersion:

- (BOOL) isLessThanVersion: (nullable GDVersion *)  anotherVersion
Returns
YES if this version is less than the specified version.
NO Otherwise.

Property Documentation

◆ stringValue

- (NSString*) stringValue
readnonatomicassign
Returns
Dotted string representation of this version.

The documentation for this class was generated from the following file:
GDVersion::stringValue
NSString * stringValue
Dotted string representation.
Definition: GDVersion.h:83
GDVersion
BlackBerry Dynamics entitlement version.
Definition: GDVersion.h:18
-[GDVersion numberOfVersionParts]
NSUInteger numberOfVersionParts()
Count of how many constituent numbers are in the version.