public class MxId
extends java.lang.Object
It is composed by the business process (business area), functionality (message type), variant and version. For a better understanding of ISO 20022 variants check https://www.iso20022.org/variants.page
Constructor and Description |
---|
MxId() |
MxId(MxBusinessProcess businessProcess,
java.lang.String funString,
java.lang.String varString,
java.lang.String verString) |
MxId(java.lang.String namespace)
Creates a new object getting data from an MX message namespace.
|
MxId(java.lang.String bpString,
java.lang.String funString,
java.lang.String varString,
java.lang.String verString) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
camelized() |
boolean |
equals(java.lang.Object o) |
MxBusinessProcess |
getBusinessProcess()
Gets the business process (a.k.a.
|
java.lang.String |
getFunctionality()
Gets the functionality (a.k.a.
|
int |
getFunctionalityInt() |
java.lang.String |
getVariant() |
int |
getVariantInt() |
java.lang.String |
getVersion() |
int |
getVersionInt() |
int |
hashCode() |
java.lang.String |
id()
Get a string in the form of businessprocess.functionality.variant.version
|
boolean |
matches(MxId other)
Check if this identification matches another one.
|
boolean |
matches(java.lang.String namespace)
Check if this identification matches the given namespace.
|
java.lang.String |
namespaceURI()
Creates the corresponding ISO 20022 namespace URI for this MX, for example: urn:swift:xsd:camt.003.001.04
All id attributes should be properly filled.
|
MxId |
setBusinessProcess(MxBusinessProcess businessProcess) |
MxId |
setFunctionality(java.lang.String functionality) |
MxId |
setVariant(java.lang.String variant) |
MxId |
setVersion(java.lang.String version) |
java.lang.String |
toString() |
public MxId()
public MxId(java.lang.String namespace)
The implementation parses the namespace using a regex to detect the message type part.
namespace
- a complete or partial namespace such as "urn:iso:std:iso:20022:tech:xsd:pain.001.001.03" or just "pain.001.001.03"java.lang.IllegalArgumentException
- if namespace parameter cannot be parsed as MX identificationpublic MxId(MxBusinessProcess businessProcess, java.lang.String funString, java.lang.String varString, java.lang.String verString)
public MxId(java.lang.String bpString, java.lang.String funString, java.lang.String varString, java.lang.String verString)
public MxBusinessProcess getBusinessProcess()
public MxId setBusinessProcess(MxBusinessProcess businessProcess)
public java.lang.String getFunctionality()
public MxId setFunctionality(java.lang.String functionality)
public java.lang.String getVariant()
public MxId setVariant(java.lang.String variant)
public java.lang.String getVersion()
public MxId setVersion(java.lang.String version)
public java.lang.String camelized()
public int getVersionInt()
public int getVariantInt()
public int getFunctionalityInt()
public java.lang.String namespaceURI()
public java.lang.String id()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public boolean matches(java.lang.String namespace)
This is particularly useful if this identifier is not completely filled, for example: if the business process
is set to "pain" and the functionality is set to "002" but the variant and version are left null, then this
identifier will match any namespace containing pain.002.*.* where the wildcard could be any number.
new MxId("pain", "002", null, null).matches("pain.002.001.03") will be true.
namespace
- a complete or partial namespace such as "urn:iso:std:iso:20022:tech:xsd:pain.001.001.03" or just "pain.001.001.03"java.lang.IllegalArgumentException
- if namespace parameter cannot be parsed as MX identificationpublic boolean matches(MxId other)
This is particularly useful if this identifier is not completely filled, for example: if the business process is set to "pain" and the functionality is set to "002" but the variant and version are left null, then this identifier will match for example both pain.002.001.03 and pain.002.002.04.
The difference between this implementation and equals(Object)
is that here null and empty properties
are treated as equals. Meaning it is not sensible to null versus blank properties, thus pain.001.001.null will
match pain.001.001.empty.
other
- an identification to comparejava.lang.IllegalArgumentException
- if namespace parameter cannot be parsed as MX identification