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
|
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. |
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, isEmpty, setBlockValue, setValue, size
getBlockType, getId, getInput, getOutput, getUnparsedTexts, getUnparsedTextsSize, isTagBlock, setBlockType, setId, setInput, setOutput, setUnparsedTexts, unparsedTextAddText, unparsedTextAddText, unparsedTextGetAsMessage, unparsedTextGetText, unparsedTextIsMessage
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 void setMessageType(java.lang.String messageType)
messageType
- String of 3 characterpublic java.lang.String getMessageType()
public void setMessagePriority(java.lang.String messagePriority)
messagePriority
- the message prioritypublic java.lang.String getMessagePriority()
public 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