com.prowidesoftware.swift.model
Class SwiftBlock2

java.lang.Object
  extended by com.prowidesoftware.swift.model.SwiftBlock
      extended by com.prowidesoftware.swift.model.SwiftValueBlock
          extended by com.prowidesoftware.swift.model.SwiftBlock2
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
SwiftBlock2Input, SwiftBlock2Output

public abstract class SwiftBlock2
extends SwiftValueBlock
implements java.io.Serializable

Base class for SWIFT Application Header Block (block 2).
The Application Header contains information about the message type and the destination of the message. This is an optional blockin SWIFT messages.

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 managment.

This is an abstract class so especific block 2 subclasses should be instantiated.

Since:
4.0
Version:
$Id: SwiftBlock2.java,v 1.1.1.1 2013/04/10 17:04:50 mgriffa Exp $
Author:
www.prowidesoftware.com
See Also:
Serialized Form

Field Summary
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.
 
Fields inherited from class com.prowidesoftware.swift.model.SwiftBlock
blockType, id, input, output, unparsedTexts
 
Constructor Summary
SwiftBlock2()
          Default Constructor
 
Method Summary
 void clean()
          Sets all attributes to null
 boolean equals(java.lang.Object obj)
           
 java.lang.String getMessagePriority()
          Gets the message priority
 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 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 toString()
          convert this to string
 
Methods inherited from class com.prowidesoftware.swift.model.SwiftValueBlock
getBlockValue, getValue, getValuePart, isEmpty, setBlockValue, setValue, size
 
Methods inherited from class com.prowidesoftware.swift.model.SwiftBlock
getBlockType, getId, getInput, getOutput, getUnparsedTexts, getUnparsedTextsSize, isTagBlock, setBlockType, setId, setInput, setOutput, setUnparsedTexts, unparsedTextAddText, unparsedTextAddText, unparsedTextGetAsMessage, unparsedTextGetText, unparsedTextIsMessage, unparsedTextVerify
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

messagePriority

protected java.lang.String messagePriority
String of 1 character containing the message priority as follows:
S = System
N = Normal
U = Urgent


messageType

protected java.lang.String messageType
String of 3 character containing the Message Type (MT) as classified and numbered by SWIFT. Three-digit FIN message type, 000 � 999.

Constructor Detail

SwiftBlock2

public SwiftBlock2()
Default Constructor

Method Detail

setBlockNumber

protected void setBlockNumber(java.lang.Integer blockNumber)
Sets the block number. Will cause an exception unless setting block number to 2.

Specified by:
setBlockNumber in class SwiftBlock
Parameters:
blockNumber - the block number to set
Throws:
java.lang.IllegalArgumentException - if parameter blockName is not the integer 2
Since:
5.0

setBlockName

protected void setBlockName(java.lang.String blockName)
Sets the block name. Will cause an exception unless setting block number to "2".

Specified by:
setBlockName in class SwiftBlock
Parameters:
blockName - the block name to set
Throws:
java.lang.IllegalArgumentException - if parameter blockName is not the string "2"
Since:
5.0

getNumber

public java.lang.Integer getNumber()
Returns the block number (the value 2 as an integer)

Specified by:
getNumber in class SwiftBlock
Returns:
Integer containing the block's number

getName

public java.lang.String getName()
Returns the block name (the value 2 as a string)

Specified by:
getName in class SwiftBlock
Returns:
block name
Since:
5.0

toString

public java.lang.String toString()
convert this to string

Overrides:
toString in class SwiftBlock

setMessageType

public void setMessageType(java.lang.String messageType)
Sets the Message Type (MT) as classified and numbered by SWIFT. Three-digit FIN message type, 000 � 999.

Parameters:
messageType - String of 3 character

getMessageType

public java.lang.String getMessageType()
Gets the Message Type (MT) as classified and numbered by SWIFT.

Returns:
messageType String of 3 character

setMessagePriority

public void setMessagePriority(java.lang.String messagePriority)
Set the message priority

Parameters:
messagePriority - the message priority

getMessagePriority

public java.lang.String getMessagePriority()
Gets the message priority

Returns:
message priority

isInput

public boolean isInput()
Returns true if this block 2 is an input block 2.

Returns:
true if block 2 is input, of false in other case

isOutput

public boolean isOutput()
Returns true if this block 2 is an output block 2.

Returns:
true if block 2 is output, of false in other case

clean

public void clean()
Sets all attributes to null

Since:
6.4

hashCode

public int hashCode()
Overrides:
hashCode in class SwiftBlock

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class SwiftBlock