class Mrz {

    public boolean valid() {
        try {
            if (mrz.startsWith("P")) {
                return checkPassportMRZ(mrz);
            } else if (mrz.startsWith("I")){
                return checkIDMRZ(mrz);
            }
        } catch (Exception ignored) {
            // Probably an outOfBounds indicating the format was incorrect
        }
        return false;
    }

    public  Mrz(String mrz);

}