BlackBerry Dynamics entitlement version. More...
#import <GDVersion.h>
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: (GDMac) results list.
#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.
- (GDVersion*) initWithString: | (NSString *) | versionString |
GDVersion
object with constituent version numbers read from a dotted string representation. - (GDVersion*) initWithArray: | (NSArray *) | array |
GDVersion
object with constituent version numbers initialized from an array of NSNumber
objects. - (NSUInteger) numberOfVersionParts |
NSUInteger
representation of the count of how many constituent numbers there are in the version. - (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.
- (NSComparisonResult) compare: | (GDVersion *) | anotherVersion |
NSComparisonResult
representing the relative value of this version compared to the other version. - (BOOL) isEqualToVersion: | (GDVersion *) | anotherVersion |
YES
if the two versions are the same. NO
Otherwise. - (BOOL) isGreaterThanVersion: | (GDVersion *) | anotherVersion |
YES
if this version is more than the specified version. NO
Otherwise. - (BOOL) isLessThanVersion: | (GDVersion *) | anotherVersion |
YES
if this version is less than the specified version. NO
Otherwise. - (NSString*) stringValue [read, assign] |