@ Nonnull @ ReturnsMutableCopy public ICommonsList < IBANElementValue > parseToElementValues ( @ Nonnull final String sIBAN ) { ValueEnforcer . notNull ( sIBAN , "IBANString" ) ; final String sRealIBAN = IBANManager . unifyIBAN ( sIBAN ) ; if ( sRealIBAN . length ( ) != m_nExpectedLength ) throw new IllegalArgumentException ( "Passed IBAN has an invalid length. Expected " + m_nExpectedLength + " but found " + sRealIBAN . length ( ) ) ; final ICommonsList < IBANElementValue > ret = new CommonsArrayList <> ( m_aElements . size ( ) ) ; int nIndex = 0 ; for ( final IBANElement aElement : m_aElements ) { final String sIBANPart = sRealIBAN . substring ( nIndex , nIndex + aElement . getLength ( ) ) ; ret . add ( new IBANElementValue ( aElement , sIBANPart ) ) ; nIndex += aElement . getLength ( ) ; } return ret ; }
Parse a given IBAN number string and convert it to elements according to this country s definition of IBAN numbers .