public abstract class SwiftBlock2 extends SwiftValueBlock implements Serializable
There are two types of application headers: Input and Output. Both, input and output block 2 flavors are fixed-length and continuous with no field delimiters. The fields that conform the blocks's value are represented in the subclasses as individual attributes for easier management.
This is an abstract class so specific block 2 subclasses should be instantiated.
Modifier and Type | Field and Description |
---|---|
protected String |
messagePriority
String of 1 character containing the message priority as follows:
S = System N = Normal U = Urgent |
protected String |
messageType
String of 3 character containing the Message Type (MT)
as classified and numbered by SWIFT.
|
blockType, id, input, output, unparsedTexts
Constructor and Description |
---|
SwiftBlock2()
Default Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
clean()
Sets all attributes to null
|
boolean |
equals(Object obj) |
String |
getMessagePriority()
Gets the message priority
|
String |
getMessageType()
Gets the Message Type (MT) as classified and numbered by SWIFT.
|
String |
getName()
Returns the block name (the value 2 as a string)
|
Integer |
getNumber()
Returns the block number (the value 2 as an integer)
|
int |
hashCode() |
boolean |
isInput()
Returns
true if this block 2 is an input block 2. |
boolean |
isOutput()
Returns
true if this block 2 is an output block 2. |
protected void |
setBlockName(String blockName)
Sets the block name.
|
protected void |
setBlockNumber(Integer blockNumber)
Sets the block number.
|
void |
setMessagePriority(String messagePriority)
Set the message priority
|
void |
setMessageType(String messageType)
Sets the Message Type (MT) as classified and numbered by SWIFT.
|
String |
toJson()
intended to be overwritten
|
String |
toString()
convert this to string
|
getBlockValue, getValue, getValuePart, isEmpty, setBlockValue, setValue, size
getBlockType, getId, getUnparsedTexts, getUnparsedTextsSize, isTagBlock, setBlockType, setId, setInput, setOutput, setUnparsedTexts, unparsedTextAddText, unparsedTextAddText, unparsedTextGetAsMessage, unparsedTextGetText, unparsedTextIsMessage, unparsedTextVerify
protected String messagePriority
protected String messageType
public void clean()
public boolean equals(Object obj)
equals
in class SwiftBlock
public String getMessagePriority()
public String getMessageType()
public String getName()
getName
in class SwiftBlock
public Integer getNumber()
getNumber
in class SwiftBlock
public int hashCode()
hashCode
in class SwiftBlock
public boolean isInput()
true
if this block 2 is an input block 2.true
if block 2 is input, of false
in other casepublic boolean isOutput()
true
if this block 2 is an output block 2.true
if block 2 is output, of false
in other caseprotected void setBlockName(String blockName)
setBlockName
in class SwiftBlock
blockName
- the block name to setIllegalArgumentException
- if parameter blockName is not the string "2"protected void setBlockNumber(Integer blockNumber)
setBlockNumber
in class SwiftBlock
blockNumber
- the block number to setIllegalArgumentException
- if parameter blockName is not the integer 2public void setMessagePriority(String messagePriority)
messagePriority
- the message prioritypublic void setMessageType(String messageType)
messageType
- String of 3 characterpublic String toJson()
public String toString()
toString
in class SwiftBlock