Class MrzResult


  • public final class MrzResult
    extends java.lang.Object
    Represents data extracted from MRZ (Machine Readable Zone) of Machine Readable Travel Document (MRTD).
    • Constructor Summary

      Constructors 
      Constructor Description
      MrzResult​(long nativeContext, java.lang.Object keep)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getAge()
      The current age of the document owner in years.
      AgeLimitStatus getAgeLimitStatus​(int ageLimit)
      Calculates whether the document owner is older than the given ageLimit in years or not.
      java.lang.String getAlienNumber()
      Returns alien number.
      java.lang.String getApplicationReceiptNumber()
      Returns application receipt number.
      DateResult getDateOfBirth()
      Returns holder's date of birth
      DateResult getDateOfExpiry()
      Returns date of expiry
      java.lang.String getDocumentCode()
      Returns document code.
      java.lang.String getDocumentNumber()
      Returns document number.
      MrtdDocumentType getDocumentType()
      Returns the MRTD document type of recognized document.
      java.lang.String getGender()
      Returns gender of the card holder.
      java.lang.String getImmigrantCaseNumber()
      Returns immigrant case number.
      java.lang.String getIssuer()
      Returns three-letter or two-letter code which indicate the issuing State.
      java.lang.String getIssuerName()
      Returns full issuer name that is expanded from the three-letter or two-letter code which indicate the issuing State.
      java.lang.String getMrzText()
      Returns the entire Machine Readable Zone text from ID.
      java.lang.String getNationality()
      Returns nationality of the holder represented by a three-letter or two-letter code.
      java.lang.String getNationalityName()
      Returns full nationality of the holder, which is expanded from the three-letter or two-letter nationality code.
      java.lang.String getOpt1()
      Returns first optional data.
      java.lang.String getOpt2()
      Returns second optional data.
      java.lang.String getPrimaryId()
      Returns the primary indentifier.
      java.lang.String getSanitizedDocumentCode()
      Returns document code, but without additional '<' characters if they exist.
      java.lang.String getSanitizedDocumentNumber()
      Returns document number, but without additional '<' characters if they exist.
      java.lang.String getSanitizedIssuer()
      Returns issuer, but without additional '<' characters if they exist.
      java.lang.String getSanitizedNationality()
      Returns nationality, but without additional '<' characters if they exist.
      java.lang.String getSanitizedOpt1()
      Returns opt1 field, but without additional '<' characters if they exist.
      java.lang.String getSanitizedOpt2()
      Returns opt2 field, but without additional '<' characters if they exist.
      java.lang.String getSecondaryId()
      Returns the secondary identifier.
      boolean isMrzParsed()
      Returns true if Machine Readable Zone has been parsed, false otherwise.
      boolean isMrzVerified()
      Returns true if all check digits inside MRZ are correct, false otherwise.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MrzResult

        public MrzResult​(long nativeContext,
                         @Nullable
                         java.lang.Object keep)
        Parameters:
        nativeContext - Native MRZ result.
        keep - Owner of the native MRZ result.
    • Method Detail

      • getDocumentType

        @NonNull
        public MrtdDocumentType getDocumentType()
        Returns the MRTD document type of recognized document.
        Returns:
        Recognized MRTD document type.
      • getPrimaryId

        @NonNull
        public java.lang.String getPrimaryId()
        Returns the primary indentifier. If there is more than one component, they are separated with space.
        Returns:
        the primary indentifier
      • getSecondaryId

        @NonNull
        public java.lang.String getSecondaryId()
        Returns the secondary identifier. If there is more than one component, they are separated with space.
        Returns:
        the secondary identifier
      • getIssuer

        @NonNull
        public java.lang.String getIssuer()
        Returns three-letter or two-letter code which indicate the issuing State. Three-letter codes are based on Aplha-3 codes for entities specified in ISO 3166-1, with extensions for certain States. Two-letter codes are based on Aplha-2 codes for entities specified in ISO 3166-1, with extensions for certain States.
        Returns:
        three-letter or two-letter code which indicate the issuing State
      • getSanitizedIssuer

        @NonNull
        public java.lang.String getSanitizedIssuer()
        Returns issuer, but without additional '<' characters if they exist.
        See Also:
        getIssuer()
      • getIssuerName

        @NonNull
        public java.lang.String getIssuerName()
        Returns full issuer name that is expanded from the three-letter or two-letter code which indicate the issuing State.
        Returns:
        full issuer name that is expanded from the three-letter or two-letter issuer code.
      • getDateOfBirth

        @NonNull
        public DateResult getDateOfBirth()
        Returns holder's date of birth
        Returns:
        holder's date of birth
      • getAge

        public int getAge()
        The current age of the document owner in years. It is calculated as difference between now and date of birth. Now is current time on the device.
        Returns:
        current age of the document owner in years or -1 if date of birth is unknown.
      • getAgeLimitStatus

        public AgeLimitStatus getAgeLimitStatus​(int ageLimit)
        Calculates whether the document owner is older than the given ageLimit in years or not. Status is calculated by using the date of birth and the current time on the device.
        Parameters:
        ageLimit - age limit in years
        Returns:
        age limit status for the document owner:
      • getDocumentNumber

        @NonNull
        public java.lang.String getDocumentNumber()
        Returns document number. Document number contains up to 9 characters. Element does not exist on US Green Card. To see which document was scanned use getDocumentType().
        Returns:
        document number or empty string if not available
      • getSanitizedDocumentNumber

        @NonNull
        public java.lang.String getSanitizedDocumentNumber()
        Returns document number, but without additional '<' characters if they exist.
        See Also:
        getDocumentNumber()
      • getNationality

        @NonNull
        public java.lang.String getNationality()
        Returns nationality of the holder represented by a three-letter or two-letter code. Three-letter codes are based on Alpha-3 codes for entities specified in ISO 3166-1, with extensions for certain States. Two-letter codes are based on Aplha-2 codes for entities specified in ISO 3166-1, with extensions for certain States.
        Returns:
        nationality of the holder represented by a three-letter or two-letter code
      • getSanitizedNationality

        @NonNull
        public java.lang.String getSanitizedNationality()
        Returns nationality, but without additional '<' characters if they exist.
        See Also:
        getNationality()
      • getNationalityName

        @NonNull
        public java.lang.String getNationalityName()
        Returns full nationality of the holder, which is expanded from the three-letter or two-letter nationality code.
        Returns:
        full nationality of the holder, which is expanded from the three-letter or two-letter nationality code.
      • getGender

        @NonNull
        public java.lang.String getGender()
        Returns gender of the card holder. Gender is specified by use of the single initial, capital letter F for female, M for male or < for unspecified.
        Returns:
        gender of the holder.
      • getDocumentCode

        @NonNull
        public java.lang.String getDocumentCode()
        Returns document code. Document code contains two characters. For MRTD the first character shall be A, C or I. The second character shall be discretion of the issuing State or organization except that V shall not be used, and `C` shall not be used after `A` except in the crew member certificate. On machine-readable passports (MRP) first character shall be `P` to designate an MRP. One additional letter may be used, at the discretion of the issuing State or organization, to designate a particular MRP. If the second character position is not used for this purpose, it shall be filled by the filter character <.
        Returns:
        document code
      • getSanitizedDocumentCode

        @NonNull
        public java.lang.String getSanitizedDocumentCode()
        Returns document code, but without additional '<' characters if they exist.
        See Also:
        getDocumentCode()
      • getDateOfExpiry

        @NonNull
        public DateResult getDateOfExpiry()
        Returns date of expiry
        Returns:
        date of expiry
      • getOpt1

        @NonNull
        public java.lang.String getOpt1()
        Returns first optional data. Returns empty string if not available. Element does not exist on US Green Card. To see which document was scanned use getDocumentType().
        Returns:
        first optional data or empty string if not available
      • getSanitizedOpt1

        @NonNull
        public java.lang.String getSanitizedOpt1()
        Returns opt1 field, but without additional '<' characters if they exist.
        See Also:
        getOpt1()
      • getOpt2

        @NonNull
        public java.lang.String getOpt2()
        Returns second optional data. Returns empty string if not available. Element does not exist on Passports and Visas. To see which document was scanned use getDocumentType().
        Returns:
        second optional data or empty string if not available
      • getSanitizedOpt2

        @NonNull
        public java.lang.String getSanitizedOpt2()
        Returns opt2 field, but without additional '<' characters if they exist.
        See Also:
        getOpt2()
      • getAlienNumber

        @NonNull
        public java.lang.String getAlienNumber()
        Returns alien number. Returns empty string if not available. Exists only on US Green Cards. To see which document was scanned use getDocumentType().
        Returns:
        alien number or empty string if not available
      • getApplicationReceiptNumber

        @NonNull
        public java.lang.String getApplicationReceiptNumber()
        Returns application receipt number. Returns empty string if not available. Exists only on US Green Cards. To see which document was scanned use getDocumentType().
        Returns:
        application receipt number or empty string if not available.
      • getImmigrantCaseNumber

        @NonNull
        public java.lang.String getImmigrantCaseNumber()
        Returns immigrant case number. Returns empty string if not available. Exists only on US Green Cards. To see which document was scanned use getDocumentType().
        Returns:
        immigrant case number or empty string if not available.
      • getMrzText

        @NonNull
        public java.lang.String getMrzText()
        Returns the entire Machine Readable Zone text from ID. This text is usually used for parsing other elements. NOTE: This string is available only if OCR result was parsed successfully.
        Returns:
        the entire Machine Readable Zone text from ID.
      • isMrzParsed

        public boolean isMrzParsed()
        Returns true if Machine Readable Zone has been parsed, false otherwise.
        Returns:
        true if Machine Readable Zone has been parsed, false otherwise.
      • isMrzVerified

        public boolean isMrzVerified()
        Returns true if all check digits inside MRZ are correct, false otherwise.
        Returns:
        true is all check digits inside MRZ are correct, false otherwise.