AbstractData
@interface AbstractData : NSObject {
NSMutableDictionary<TagInfo *, id> *map;
}
Abstract class AbstractData
model is the root of Data hierarchy, containing the basic common functions applicable to all Data classes. All Data classes will have AbstractData
model as its superclass.
-
Map of contained tagInfo and their value
Declaration
Objective-C
NSMutableDictionary<TagInfo *, id> *map
-
Type of represented tags
Declaration
Objective-C
@property (assign, readwrite, atomic, nonnull) Class<Tag> tagType;
-
Initializer
Declaration
Objective-C
- (id _Nonnull)init:(Class<Tag> _Nonnull)tagType;
Parameters
tagType
Type of tags this data represents
-
Initializer
Declaration
Objective-C
- (id _Nonnull)init:(Class<Tag> _Nonnull)tagType regex:(NSString *_Nullable)regex rootTag:(NSString *_Nullable)rTag;
Parameters
tagType
Type of tags this data represents
regex
for checking RFU
rTag
is the tag in the containing object
-
Returns count of total tag info key value pair
Declaration
Objective-C
- (NSInteger)tagInfoCount;
Swift
func tagInfoCount() -> Int
Return Value
Total number of tag info key value pair
-
Get value for tagInfo
Declaration
Objective-C
- (id _Nullable)getTagInfoValueForTagString:(NSString *_Nonnull)strTagInfo error: (NSError *_Nullable *_Nullable)error;
Swift
func getTagInfoValue(forTagString strTagInfo: String) throws -> Any
Parameters
strTagInfo
NSString* tag for which to get value
Return Value
Value if found else
nil
-
Set value for tagInfo
Declaration
Objective-C
- (BOOL)setTagInfoValue:(id _Nonnull)value forTagString:(NSString *_Nonnull)strTagInfo error:(NSError *_Nullable *_Nullable)error;
Swift
func setTagInfoValue(_ value: Any, forTagString strTagInfo: String) throws
Parameters
value
Value to set
strTagInfo
NSString* tag to set the value of
-
Set value in range of tag
Used for MAI Data, Unrestricted data in push payment data, or unrestricted data in additional data
Declaration
Objective-C
- (BOOL)setValueInTagRange:(id _Nonnull)value low:(int)low high:(int)high error:(NSError *_Nullable *_Nullable)error;
Swift
func setValueInTagRange(_ value: Any, low: Int32, high: Int32) throws
Parameters
value
of to be inserted
low
lower index inclusive
high
higher index exclusive
-
Set RootTag: the root tag that the object belong to
Declaration
Objective-C
- (void)setRootTag:(NSString *_Nullable)rootTag;
Swift
func setRootTag(_ rootTag: String?)
Parameters
rootTag
can be null
-
Validate data
Note
Throws:MPQRError.missingTag
if the value for tag info is not present while the tag was mandatory.MPQRError.invalidTagValue
If the value doesn’t match pattern of the tag. And if the length of string representation of the value is out of [1, 99] range
Declaration
Objective-C
- (BOOL)validate:(NSError *_Nullable *_Nullable)err;
Swift
func validate() throws
-
Checks internal data for RFU tags
Note
Throws RFUTagException if internal data contains an RFU tagDeclaration
Objective-C
- (BOOL)checkForRFU:(NSError *_Nullable *_Nullable)error;
Swift
func checkForRFU() throws
-
String representation of the data. It will generate a string which is parseable back to data
Declaration
Objective-C
- (NSString *_Nonnull)description;
Swift
func description() -> String
-
Dump internal data in a string representation Useful for debugging purposes
Declaration
Objective-C
- (NSString *_Nonnull)dumpData;
Swift
func dumpData() -> String
Return Value
String representation of internal data
-
Equality check
Declaration
Objective-C
- (BOOL)isEqual:(id _Nullable)object;
Swift
func isEqual(_ object: Any?) -> Bool