public class SwiftBlock1 extends SwiftValueBlock implements java.io.Serializable
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
APPLICATION_ID_FIN
Constant for FIN messages in application id
|
static java.lang.String |
APPLICATION_ID_GPA
Constant for GPA (General Purpose Application) messages in application id
|
static java.lang.String |
APPLICATION_ID_LOGINS
Constant for Logins and so messages in application id
|
blockType, id, input, output, unparsedTexts
Constructor and Description |
---|
SwiftBlock1()
Default constructor
|
SwiftBlock1(java.lang.String value)
Creates a block 1 object setting attributes by parsing the fixed string argument;
for example "F01BANKBEBBAXXX2222123456" or "1:F01BANKBEBBAXXX2222123456" |
SwiftBlock1(java.lang.String applicationId,
java.lang.String serviceId,
java.lang.String logicalTerminal,
java.lang.String sessionNumber,
java.lang.String sequenceNumber)
Constructor for specific values
|
Modifier and Type | Method and Description |
---|---|
void |
clean()
Sets all attributes to null
|
boolean |
equals(java.lang.Object obj) |
java.lang.String |
getApplicationId()
Gets the application ID field in block 1
|
java.lang.String |
getBlockValue()
This method should be overwritten by subclasses, calling
this method will throw a
java.lang.UnsupportedOperationException |
java.lang.String |
getLogicalTerminal()
Gets the The Logical Terminal address of the sender for messages
sent or the receiver for messages received from the SWIFT network.
|
java.lang.String |
getName()
Returns the block name (the value 1 as a string)
|
java.lang.Integer |
getNumber()
Returns the block number (the value 1 as an integer)
|
java.lang.String |
getSequenceNumber()
Gets the sequence number field in block 1
|
java.lang.String |
getServiceId()
Gets the service ID field in block 1
|
java.lang.String |
getSessionNumber()
Gets the session number in block 1
|
java.lang.String |
getValue()
Gets the fixed length block 1 value, as a result of
concatenating its individual elements as follow:
Application ID Service ID + Logical terminal (LT) address + Session number + Sequence number. Notice that this method does not return the "1:" string. |
int |
hashCode() |
boolean |
isEmpty()
Tell if this block is empty or not.
|
void |
setApplicationId(java.lang.String applicationId)
Sets the applicationId
|
protected void |
setBlockName(java.lang.String blockName)
Sets the block name.
|
protected void |
setBlockNumber(java.lang.Integer blockNumber)
Sets the block number.
|
void |
setBlockValue(java.lang.String value)
This method should be overwritten by subclasses, calling
this method will throw a
java.lang.UnsupportedOperationException |
void |
setLogicalTerminal(java.lang.String logicalTerminal)
Sets the The Logical Terminal address of the sender for messages
sent or the receiver for messages received from the SWIFT network.
|
void |
setSender(java.lang.String BIC)
Sets the Logical Terminal.
|
void |
setSequenceNumber(java.lang.String sequenceNumber)
Sets the Sequence number that is generated by the
user's computer.
For all FIN messages with a Service Identifier of 01 or 05, this number is the next expected sequence number appropriate to the direction of the transmission. For FIN messages with a Service Identifier of 21 or 25, the sequence number is that of the acknowledged service message. It is padded with zeros. |
void |
setServiceId(java.lang.String serviceId)
Sets the Service ID
|
void |
setSessionNumber(java.lang.String sessionNumber)
Sets the Session number.
|
void |
setValue(java.lang.String value)
Sets the block's attributes by parsing the fixed string argument;
for example "F01BANKBEBBAXXX2222123456" or "1:F01BANKBEBBAXXX2222123456" |
getValuePart, size
getBlockType, getId, getInput, getOutput, getUnparsedTexts, getUnparsedTextsSize, isTagBlock, setBlockType, setId, setInput, setOutput, setUnparsedTexts, toString, unparsedTextAddText, unparsedTextAddText, unparsedTextGetAsMessage, unparsedTextGetText, unparsedTextIsMessage, unparsedTextVerify
public static final transient java.lang.String APPLICATION_ID_FIN
public static final transient java.lang.String APPLICATION_ID_GPA
public static final transient java.lang.String APPLICATION_ID_LOGINS
public SwiftBlock1(java.lang.String applicationId, java.lang.String serviceId, java.lang.String logicalTerminal, java.lang.String sessionNumber, java.lang.String sequenceNumber)
applicationId
- the application idserviceId
- the service idlogicalTerminal
- the logical terminal namesessionNumber
- the session numbersequenceNumber
- the message sequence numberpublic SwiftBlock1()
public SwiftBlock1(java.lang.String value)
value
- a fixed length string of 25 or 27 (which must start with '1:') characters containing the blocks valueprotected 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 1protected 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 "1"public java.lang.Integer getNumber()
getNumber
in class SwiftBlock
public java.lang.String getName()
getName
in class SwiftBlock
public void setApplicationId(java.lang.String applicationId)
applicationId
- String of 1 character containing the Application ID (F, A or L)public java.lang.String getApplicationId()
public void setServiceId(java.lang.String serviceId)
serviceId
- string of 2 characters containing Service ID (01, 02, 03, etc...)public java.lang.String getServiceId()
public void setLogicalTerminal(java.lang.String logicalTerminal)
logicalTerminal
- it is fixed at 12 characters; it must not have X in position 9 (padded with "X" if no branch is required).public void setSender(java.lang.String BIC)
setLogicalTerminal(String)
public java.lang.String getLogicalTerminal()
public void setSessionNumber(java.lang.String sessionNumber)
sessionNumber
- 4 numbers.public java.lang.String getSessionNumber()
public void setSequenceNumber(java.lang.String sequenceNumber)
sequenceNumber
- 6 numberspublic java.lang.String getSequenceNumber()
public boolean isEmpty()
null
.isEmpty
in class SwiftValueBlock
true
if all fields are null
and false in other casepublic java.lang.String getValue()
getValue
in class SwiftValueBlock
public java.lang.String getBlockValue()
SwiftValueBlock
java.lang.UnsupportedOperationException
getBlockValue
in class SwiftValueBlock
getValue()
public void setValue(java.lang.String value)
setValue
in class SwiftValueBlock
value
- a fixed length string of 25 or 27 (which must start with '1:') characters containing the blocks valuepublic void setBlockValue(java.lang.String value)
SwiftValueBlock
java.lang.UnsupportedOperationException
setBlockValue
in class SwiftValueBlock
value
- unusedsetValue(String)
public void clean()
public int hashCode()
hashCode
in class SwiftBlock
public boolean equals(java.lang.Object obj)
equals
in class SwiftBlock