AbstractData
@objc public class AbstractData : NSObject
Abstract class for data
-
Checks if value for tagInfo is present internally
Parameter
Parameter tagInfo: Tag info for which to check presenceReturns
true
if value exists elsefalse
Declaration
Swift
public func hasTagInfoValue(for tagInfo: TagInfo) -> Bool
Parameters
tagInfo
Tag info for which to check presence
Return Value
true
if value exists elsefalse
-
Get value for tagInfo
Remark
All the values are of
String
type except value for additional dataPPTag.TAG_62_ADDITIONAL_DATA_FIELD
for which the returned type would beAdditionalData
Parameter
Parameter tagInfo: Tag info for which to get value
Returns
Value if found else
nil
Declaration
Swift
public final func getTagInfoValue(for tagInfo: TagInfo) -> AnyObject?
Parameters
tagInfo
Tag info for which to get value
Return Value
Value if found else
nil
-
Set value for tagInfo
Parameter
Parameter value: Value to setParameter
Parameter tagInfo: Tag info to set the value ofDeclaration
Swift
public final func setTagInfoValue(_ value: AnyObject, for tagInfo: TagInfo)
Parameters
value
Value to set
tagInfo
Tag info to set the value of
-
Removes value related to tagInfo
Parameter
Parameter tagInfo: Remove value for tagInfoNote
This method does nothing if the value is not found for tagInfoDeclaration
Swift
public final func removeTagInfoValue(for tagInfo: TagInfo)
Parameters
tagInfo
Remove value for tagInfo
-
Returns count of total tag info key value pair
- Return: Total number of tag info key value pair
Declaration
Swift
public final func tagInfoCount() -> Int
-
Validate data
Throws
MPQRError.missingTag
if the value for tag info is not present while the tag was mandatoryMPQRError.invalidTagValue
- If the value doesn’t match pattern of the tag
- If the length of string representation of the value is out of [1, 99] range
Declaration
Swift
public func validate() throws
-
String representation of the data. It will generate a string which is parseable back to data
Declaration
Swift
public override var description: String
-
Dump internal data in a string representation
Useful for debugging purposes
Returns
String representation of internal dataDeclaration
Swift
public func dumpData() -> String
Return Value
String representation of internal data
-
Equality check
Declaration
Swift
public override func isEqual(_ object: Any?) -> Bool