public abstract class SwiftBlock extends Object implements Serializable
Modifier and Type | Field and Description |
---|---|
protected String |
blockType
helper for hibernate mapping
|
protected Long |
id
Unique identifier of the swift block.
|
protected Boolean |
input
Only valid for block2, only when using hibernate for persistence
|
protected Boolean |
output
Only valid for block2, only when using hibernate for persistence
|
protected UnparsedTextList |
unparsedTexts
List of unparsed texts.
|
Constructor and Description |
---|
SwiftBlock()
Default constructor, shouldn't be used normally.
|
SwiftBlock(UnparsedTextList unparsedText)
Constructor for an unparsed text list
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
String |
getBlockType() |
Long |
getId()
Get the unique identifier of this block or
null if it is not set |
Boolean |
getInput()
Deprecated.
use
getBlockType() |
abstract String |
getName()
Returns the block name (this method is to be overwritten for derived classes).
|
abstract Integer |
getNumber()
Returns the block number (this method is to be overwritten for derived classes).
|
Boolean |
getOutput()
Deprecated.
use
getBlockType() |
UnparsedTextList |
getUnparsedTexts()
Returns the unparsed text list attached to the Block.
|
Integer |
getUnparsedTextsSize()
returns the size of the unparsed text list
|
int |
hashCode() |
boolean |
isTagBlock()
Tell if this block is a block that contains a list of tags (3-5) or is a block with fixed length value (1-2)
|
protected abstract void |
setBlockName(String blockName)
Sets the block name (this method is to be overwrite for derived classes).
|
protected abstract void |
setBlockNumber(Integer blockNumber)
Sets the block number (this method is to be overwrite for derived classes).
|
void |
setBlockType(String blockType)
should not be normally called
|
void |
setId(Long id)
Sets the unique identifier of this block
|
void |
setInput(Boolean input)
Only valid for block2, only when using hibernate for persistence
|
void |
setOutput(Boolean output)
Only valid for block2, only when using hibernate for persistence
|
void |
setUnparsedTexts(UnparsedTextList texts)
sets the list of unparsed texts
|
String |
toString() |
void |
unparsedTextAddText(String text)
adds a new unparsed text
|
void |
unparsedTextAddText(SwiftMessage message)
adds a new unparsed text from a message
|
SwiftMessage |
unparsedTextGetAsMessage(Integer index)
get an unparsed text as a parsed swift message
|
String |
unparsedTextGetText(Integer index)
get an unparsed text
|
Boolean |
unparsedTextIsMessage(Integer index)
decides if a specific text (by index) is likely a SWIFT FIN message.
|
protected void |
unparsedTextVerify()
verifies that the unparsed text list exists
|
protected Long id
protected UnparsedTextList unparsedTexts
protected Boolean input
protected Boolean output
protected String blockType
public SwiftBlock()
public SwiftBlock(UnparsedTextList unparsedText)
unparsedText
- the list of unparsed textspublic String getBlockType()
null
if not implementedpublic void setBlockType(String blockType)
blockType
- protected abstract void setBlockNumber(Integer blockNumber)
blockNumber
- the block number to setprotected abstract void setBlockName(String blockName)
blockName
- the block name to setpublic abstract Integer getNumber()
public abstract String getName()
public Long getId()
null
if it is not setpublic void setId(Long id)
id
- the unique identifier to set.public boolean isTagBlock()
true
if this object contains a list of tags (which may be empty or null
protected void unparsedTextVerify()
public UnparsedTextList getUnparsedTexts()
public void setUnparsedTexts(UnparsedTextList texts)
texts
- the new list of unparsed texts (may be null)public Integer getUnparsedTextsSize()
public Boolean unparsedTextIsMessage(Integer index)
index
- the unparsed text numberIllegalArgumentException
- if parameter index is null
IndexOutOfBoundsException
- if parameter index is out of boundspublic String unparsedTextGetText(Integer index)
index
- the unparsed text numberIllegalArgumentException
- if parameter index is null
IndexOutOfBoundsException
- if parameter index is out of boundspublic SwiftMessage unparsedTextGetAsMessage(Integer index)
index
- the unparsed text numberIllegalArgumentException
- if parameter index is null
public void unparsedTextAddText(String text)
text
- the unparsed text to appendIllegalArgumentException
- if parameter text is null
public void unparsedTextAddText(SwiftMessage message)
message
- the message to be appendedIllegalArgumentException
- if parameter message is null
public Boolean getInput()
getBlockType()
2I
public void setInput(Boolean input)
input
- the is input parameterpublic Boolean getOutput()
getBlockType()
true
if message block type is 2O
public void setOutput(Boolean output)
output
- the is output parameter