public class BIC
extends java.lang.Object
Bank Identifier Codes (also known as SWIFT-BIC, BIC, SWIFT ID or SWIFT code) is a unique identification code for both financial and non-financial institutions. When assigned to a non-financial institution, the code may also be known as a Business Entity Identifier or BEI.
It is composed by:
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
branch |
static java.lang.String |
PARTNER_PREFIX
Constant value with which all partner bics start
|
static java.lang.String |
TEST12
Fake Logical terminal address for testing,
consisting of a fake "test & training" BIC of 12 chars
(including the terminal identification)
|
static java.lang.String |
TEST8
Fake "test & training" BIC with 8 chars for testing
|
Constructor and Description |
---|
BIC()
Default constructor
|
BIC(java.lang.String bic)
Constructor with a BIC8 or BIC11 code.
|
Modifier and Type | Method and Description |
---|---|
BIC |
asTestBic()
Returns a new BIC with second character of the location set to zero.
|
java.lang.String |
country()
Deprecated.
use
getCountry() instead |
java.lang.String |
distinguishedName()
Returns the Distinguished Name (DN) for this BIC.
|
boolean |
equals(java.lang.Object o) |
java.lang.String |
getBic11()
Returns the BIC code with 11 characters composed by institution code, country, location and branch.
|
java.lang.String |
getBic8()
Returns the first 8 characters of the BIC code, composed by the institution code, country and location.
|
java.lang.String |
getBranch()
It returns the last three that conform the branch or null if branch is not present.
|
java.lang.String |
getBranchOrDefault()
Returns the branch code or XXX as default
|
java.lang.String |
getCountry() |
java.lang.String |
getInstitution() |
java.lang.String |
getInvalidCause()
Deprecated.
use the
validate() method to get a detailed result of the validation problem found |
java.lang.String |
getLocation() |
java.lang.String |
getSubtype()
Returns ths subtype code.
|
int |
hashCode() |
java.lang.String |
institution()
Deprecated.
use
getInstitution() instead |
boolean |
isLive()
Returns true if the BIC is live (connected and not test & training) on the network.
|
boolean |
isNonLive()
Returns true if the BIC is not live (not connected) on the network.
|
boolean |
isTestAndTraining()
Returns true if the BIC is a Test & Training BIC code.
|
boolean |
isValid()
Validates the BIC structure.
|
protected void |
parse(java.lang.String bic) |
void |
setBranch(java.lang.String branch) |
void |
setCountry(java.lang.String country) |
void |
setInstitution(java.lang.String institution) |
void |
setLocation(java.lang.String location) |
void |
setSubtype(java.lang.String subtype)
Sets a subtype code
|
java.lang.String |
toString() |
BicValidationResult |
validate()
Validates the BIC structure.
|
public static final transient java.lang.String TEST8
public static final transient java.lang.String TEST12
SwiftBlock1.getLogicalTerminal()
,
Constant Field Valuespublic static final java.lang.String PARTNER_PREFIX
protected java.lang.String branch
public BIC(java.lang.String bic)
For BIC codes with 12 characters (meaning it includes the logical terminal identifier) use
LogicalTerminalAddress
instead. This implementation will drop the LT identifier if a
12 characters full logical terminal addess is passed as parameter.
If the code is longer than 11 characters, the remainder will be store as part of the branch code.
bic
- the BIC code to use in this BIC (8 or 11 chars)public BIC()
protected void parse(java.lang.String bic)
@Deprecated @ProwideDeprecated(phase4=SRU2021) public java.lang.String getInvalidCause()
validate()
method to get a detailed result of the validation problem foundpublic boolean isValid()
for details regarding the validation checks or if you need structured details of the validation
problem found.
public BicValidationResult validate()
Checks the syntax of the BIC, verifying: the total length is 8, 11 or 12 (LT identifier), the country is a
valid ISO country code using IsoUtils
, the institution is composed by upper case letters and the
location and branch are composed by upper case letter or digits.
This method does not validate against any BIC directory.
public java.lang.String getBranch()
public void setBranch(java.lang.String branch)
branch
- the branch part of the BICpublic java.lang.String getBranchOrDefault()
public java.lang.String getSubtype()
setSubtype(String)
public void setSubtype(java.lang.String subtype)
public boolean isTestAndTraining()
In SWIFT’s FIN messaging system, a BIC with a zero in the 8th position is a Test & Training BIC, and as such it cannot be used in production FIN messages.
public boolean isNonLive()
BICs can identify not only financial institutions but also non-financial ones either connected or not connected to the SWIFT network.
A BIC of an institution which is not connected to the SWIFT network still has a location code with the digit 1 at the end (for instance AFSEUS31). BICs like that are called non-SWIFT BICs (or BIC 1).
In SWIFT’s FIN messaging system, a BIC with a one in the 8th position is a Non-Live BIC.
Note this is not the opposite of isLive()
public boolean isLive()
BICs can identify not only financial institutions but also non-financial ones either connected or not connected to the SWIFT network.
In SWIFT’s FIN messaging system, a BIC with a character different than zero (that would be Test & Training) or one (that would be non-connected) in the 8th position is a Live BIC.
Note this is not the opposite of isNonLive()
public java.lang.String getBic8()
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String getBic11()
If the branch is not present, then XXX will be used as default branch.
@ProwideDeprecated(phase4=SRU2021) @Deprecated public java.lang.String country()
getCountry()
instead@ProwideDeprecated(phase4=SRU2021) @Deprecated public java.lang.String institution()
getInstitution()
insteadpublic java.lang.String distinguishedName()
The created DN always includes the BIC8 and "swift" and if the branch is present and not "XXX" it will also be included as organization unit (ou)
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getInstitution()
public void setInstitution(java.lang.String institution)
institution
- the institution identifier part of the BICpublic java.lang.String getCountry()
public void setCountry(java.lang.String country)
country
- the country part of the BICpublic java.lang.String getLocation()
public void setLocation(java.lang.String location)
location
- the location part of the BICpublic BIC asTestBic()