public class MtSwiftMessage extends AbstractSwiftMessage
identifier, IDENTIFIER_ACK, IDENTIFIER_NAK, PROPERTY_NAME, receiver, sender| Constructor and Description |
|---|
MtSwiftMessage() |
MtSwiftMessage(File file)
Creates a new message reading the message the content from a file.
|
MtSwiftMessage(InputStream stream)
Creates a new message reading the message the content from an input stream.
|
MtSwiftMessage(String fin)
Creates a new message reading the message the content from a string.
|
MtSwiftMessage(SwiftMessage model)
Creates an MtSwiftMessage from a SwiftMessage.
|
| Modifier and Type | Method and Description |
|---|---|
void |
copyTo(MtSwiftMessage msg)
copies attributes from this object to the given object
non inherited copied attributes:
mir
modelMessage
mur
pde
pdm
uuid
|
boolean |
equals(Object obj) |
String |
getMessageName()
Get the value of the property under the
AbstractSwiftMessage.PROPERTY_NAME key or the result of getMessageType() |
String |
getMessageType()
Get the message type.
For MTs this is the MT type number present in the identifier attribute. |
Integer |
getMessageTypeInt()
Get the integer value of the
getMessageType()
or null if the identifier attribute is not set or not a number |
String |
getMir() |
SwiftMessage |
getModelMessage()
Deprecated.
The internal model message is no longer kept as class attribute to avoid
inconsistencies between the raw format and the parsed data. To parse the internal raw
format into a model object use
modelMessage() instead of this getter. |
String |
getMur() |
String |
getPde() |
String |
getPdm() |
String |
getUuid() |
int |
hashCode() |
boolean |
isType(int type)
Test if this message is a given specific type.
|
boolean |
isType(Integer... type)
Tell if this message is any of the given types.
|
SwiftMessage |
modelMessage()
Parses the raw message content into a SwiftMessage object.
|
static MtSwiftMessage |
parse(File file)
Creates a new message reading the message the content from a file.
|
static MtSwiftMessage |
parse(InputStream stream)
Creates a new message reading the message the content from an input stream.
|
static MtSwiftMessage |
parse(String fin)
Creates a new message reading the message the content from a string.
|
MtSwiftMessage |
readFile(File file)
Deprecated.
use the constructor
MtSwiftMessage(File) instead |
void |
setMir(String mir) |
void |
setModelMessage(SwiftMessage modelMessage)
Deprecated.
The internal model message is no longer kept as class attribute to avoid
inconsistencies between the raw format and the parsed data. To update the internal raw
format from a model object use
updateFromModel(SwiftMessage) instead of this setter. |
void |
setMur(String mur) |
void |
setPde(String pde) |
void |
setPdm(String pdm) |
void |
setUuid(String uuid) |
String |
toString() |
void |
updateFromFIN()
Updates the derived attributes from the current raw (FIN) message attribute.
|
void |
updateFromFIN(String fin)
Updates the the attributes with the raw message and its metadata from the given raw (FIN) message content.
|
protected void |
updateFromMessage()
Updates the object attributes with metadata parsed from the message raw content:
identifier, sender, receiver, direction and specific data for the implementing subclass.
|
void |
updateFromModel()
Deprecated.
Use
updateFromModel(SwiftMessage) or constructor MtSwiftMessage(SwiftMessage) instead,
The internal model message is no longer kept as class attribute to avoid inconsistencies
between the raw format and the parsed data. |
void |
updateFromModel(AbstractMT mt)
The AbstractMT is serialized to its FIN raw format to set the internal raw message attribute.
|
void |
updateFromModel(SwiftMessage model)
The SwiftMessage is serialized to its FIN raw format to set the internal raw message attribute.
|
addNote, addRevision, addStatus, contains, contains, copyTo, createRevision, findStatusInfo, findStatusInfo, findStatusInfoLast, findStatusInfoLast, formattedAmount, formattedAmount, getAmount, getChecksum, getCreationDate, getCurrency, getDirection, getFileFormat, getFilename, getId, getIdentifier, getLastData, getLastData, getLastModified, getMessage, getNotes, getPaddedId, getPreviousStatusInfo, getProperties, getProperty, getProperty, getPropertyBoolean, getPropertyBoolean, getReceiver, getReference, getRevisions, getSender, getStatus, getStatusInfo, getStatusTrail, identifiedAsACK, identifiedAsNAK, isIncoming, isInput, isMT, isMX, isOutgoing, isOutput, isStatus, isStatus, isStatus, isStatus, match, message, messageStandardType, sanityCheckProperties, setAmount, setChecksum, setCreationDate, setCurrency, setDirection, setFileFormat, setFilename, setId, setIdentifier, setLastModified, setMessage, setNotes, setProperties, setProperty, setProperty, setReceiver, setReference, setRevisions, setSender, setStatus, setStatus, setStatusTrailpublic MtSwiftMessage()
public MtSwiftMessage(String fin)
FileFormat.FINpublic MtSwiftMessage(InputStream stream) throws IOException
FileFormat.FINIOExceptionMtSwiftMessage(String),
AbstractSwiftMessage.AbstractSwiftMessage(InputStream)public MtSwiftMessage(File file) throws IOException
FileFormat.FINIOExceptionMtSwiftMessage(String),
AbstractSwiftMessage.AbstractSwiftMessage(File)public MtSwiftMessage(SwiftMessage model)
updateFromModel()public static MtSwiftMessage parse(String fin)
MtSwiftMessage(String)public static MtSwiftMessage parse(InputStream stream) throws IOException
MtSwiftMessage(InputStream)IOExceptionpublic static MtSwiftMessage parse(File file) throws IOException
MtSwiftMessage(File)IOExceptionprotected void updateFromMessage()
throws IllegalArgumentException
AbstractSwiftMessageupdateFromMessage in class AbstractSwiftMessageIllegalArgumentException - if the source format is not FileFormat.FIN or if the message cannot be parsed into a MtSwiftMessage objectAbstractSwiftMessage.updateFromMessage()public void updateFromFIN(String fin)
fin - the new message contentupdateFromMessage()public void updateFromFIN()
public void updateFromModel(SwiftMessage model)
public void updateFromModel(AbstractMT mt)
@Deprecated @ProwideDeprecated(phase4=_2018) public void updateFromModel()
updateFromModel(SwiftMessage) or constructor MtSwiftMessage(SwiftMessage) instead,
The internal model message is no longer kept as class attribute to avoid inconsistencies
between the raw format and the parsed data.@Deprecated @ProwideDeprecated(phase3=_2018) public SwiftMessage getModelMessage()
modelMessage() instead of this getter.public SwiftMessage modelMessage()
null if the raw content is not set or cannot be parsed@Deprecated @ProwideDeprecated(phase3=_2018) public void setModelMessage(SwiftMessage modelMessage)
updateFromModel(SwiftMessage) instead of this setter.public String getMessageType()
public Integer getMessageTypeInt()
getMessageType()
or null if the identifier attribute is not set or not a numberpublic String getMessageName()
AbstractSwiftMessage.PROPERTY_NAME key or the result of getMessageType()getMessageName in class AbstractSwiftMessagepublic boolean isType(Integer... type)
type - a variable list of integers for testing to match as the current message typetrue if the current message type is any of the integers given as parameters, and false in any other casepublic boolean isType(int type)
type - the message type given as int, to testtrue if this message type is the type given, or false in any other casepublic String getPde()
public void setPde(String pde)
public String getPdm()
public void setPdm(String pdm)
public String getMir()
public void setMir(String mir)
public String getMur()
public void setMur(String mur)
public String getUuid()
public void setUuid(String uuid)
public int hashCode()
hashCode in class AbstractSwiftMessagepublic boolean equals(Object obj)
equals in class AbstractSwiftMessage@Deprecated @ProwideDeprecated(phase4=_2018) public MtSwiftMessage readFile(File file) throws IOException
MtSwiftMessage(File) insteadreadFile in class AbstractSwiftMessageIOExceptionpublic void copyTo(MtSwiftMessage msg)
msg - AbstractSwiftMessage.copyTo(AbstractSwiftMessage)