public abstract class SwiftBlock2 extends SwiftValueBlock implements java.io.Serializable
The Application Header contains information about the message type and the destination of the message.
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 | Class and Description |
---|---|
static class |
SwiftBlock2.MessagePriority
Message priority values
|
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
messagePriority
String of 1 character containing the message priority as follows:
S = System N = Normal U = Urgent |
protected java.lang.String |
messageType
String of 3 character containing the Message Type (MT) as classified and
numbered by SWIFT.
|
blockType, input, output, unparsedTexts
Constructor and Description |
---|
SwiftBlock2()
Default Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
clean()
Sets all attributes to null
|
boolean |
equals(java.lang.Object o) |
java.lang.String |
field(SwiftBlock2Field field)
Generic getter for block attributes based on qualified names from
SwiftBlock2Field |
java.lang.String |
getMessagePriority()
Gets the message priority
|
SwiftBlock2.MessagePriority |
getMessagePriorityType()
Gets the message priority as enum
|
java.lang.String |
getMessageType()
Gets the Message Type (MT) as classified and numbered by SWIFT.
|
java.lang.String |
getName()
Returns the block name (the value 2 as a string)
|
java.lang.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(java.lang.String blockName)
Sets the block name.
|
protected void |
setBlockNumber(java.lang.Integer blockNumber)
Sets the block number.
|
void |
setField(SwiftBlock2Field field,
java.lang.String value)
Generic setter for block attributes based on qualified names from
SwiftBlock2Field |
void |
setMessagePriority(java.lang.String messagePriority)
Set the message priority
|
void |
setMessageType(java.lang.String messageType)
Sets the Message Type (MT) as classified and numbered by SWIFT.
|
java.lang.String |
toJson()
Specific serialization is provided for block 2 input and output.
|
java.lang.String |
toString()
convert this to string
|
getBlockValue, getValue, getValuePart, getValuePart, isEmpty, setBlockValue, setValue, size
getBlockType, getInput, getOutput, getUnparsedTexts, getUnparsedTextsSize, isTagBlock, setBlockType, setInput, setOutput, setUnparsedTexts, unparsedTextAddText, unparsedTextAddText, unparsedTextGetAsMessage, unparsedTextGetText, unparsedTextIsMessage, unparsedTextVerify
protected java.lang.String messagePriority
protected java.lang.String messageType
protected void setBlockNumber(java.lang.Integer blockNumber)
setBlockNumber
in class SwiftBlock
blockNumber
- the block number to setjava.lang.IllegalArgumentException
- if parameter blockName is not the integer 2protected void setBlockName(java.lang.String blockName)
setBlockName
in class SwiftBlock
blockName
- the block name to setjava.lang.IllegalArgumentException
- if parameter blockName is not the string "2"public java.lang.Integer getNumber()
getNumber
in class SwiftBlock
public java.lang.String getName()
getName
in class SwiftBlock
public java.lang.String toString()
toString
in class SwiftBlock
public java.lang.String getMessageType()
public void setMessageType(java.lang.String messageType)
messageType
- String of 3 characterpublic java.lang.String getMessagePriority()
public void setMessagePriority(java.lang.String messagePriority)
messagePriority
- the message prioritypublic SwiftBlock2.MessagePriority getMessagePriorityType()
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 casepublic void clean()
public boolean equals(java.lang.Object o)
equals
in class SwiftBlock
public int hashCode()
hashCode
in class SwiftBlock
public java.lang.String toJson()
public java.lang.String field(SwiftBlock2Field field)
SwiftBlock2Field
field
- field to getpublic void setField(SwiftBlock2Field field, java.lang.String value)
SwiftBlock2Field
field
- field to setvalue
- content to set