Skip to content

Commit

Permalink
merge fix
Browse files Browse the repository at this point in the history
  • Loading branch information
zubri committed Aug 14, 2024
1 parent 139f1cc commit da3a256
Showing 1 changed file with 1 addition and 48 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ public static BusinessAppHdrV03 createBusinessAppHdrV03(
* @param reference optional reference for the BizMsgIdr (business message identifier) or null to leave not set
* @param id optional MX identification for the MsgDefIdr (message definition identifier) element or null to leave not set
* @return new header initialized from parameters.
* @since 9.5.3
* @since 10.2.2
*/
public static BusinessAppHdrV04 createBusinessAppHdrV04(
final String sender, final String receiver, final String reference, final MxId id) {
Expand Down Expand Up @@ -211,53 +211,6 @@ public static BusinessAppHdrV04 createBusinessAppHdrV04(
return h;
}

/**
* Convenient method to create a new ISO header version 4, initialized from simple parameters.
*
* <p>All parameters are optional but in order for the header to be valid the sender, receiver and reference must
* be set. Creation date will be set to current time.
*
* @param sender optional sender BIC for the Fr element or null to leave not set
* @param receiver optional receiver BIC for the To element or null to leave not set
* @param reference optional reference for the BizMsgIdr (business message identifier) or null to leave not set
* @param id optional MX identification for the MsgDefIdr (message definition identifier) element or null to leave not set
* @return new header initialized from parameters.
* @since 9.5.3
*/
public static BusinessAppHdrV04 createBusinessAppHdrV04(
final String sender, final String receiver, final String reference, final MxId id) {
BusinessAppHdrV04 h = new BusinessAppHdrV04();

if (sender != null) {
h.setFr(new Party51Choice());
h.getFr().setFIId(new BranchAndFinancialInstitutionIdentification8());
h.getFr().getFIId().setFinInstnId(new FinancialInstitutionIdentification23());
h.getFr().getFIId().getFinInstnId().setBICFI(sender);
}

if (receiver != null) {
h.setTo(new Party51Choice());
h.getTo().setFIId(new BranchAndFinancialInstitutionIdentification8());
h.getTo().getFIId().setFinInstnId(new FinancialInstitutionIdentification23());
h.getTo().getFIId().getFinInstnId().setBICFI(receiver);
}

if (reference != null) {
h.setBizMsgIdr(reference);
}

if (id != null) {
h.setMsgDefIdr(id.id());
if (id.getBusinessService().isPresent()) {
h.setBizSvc(id.getBusinessService().get());
}
}

h.setCreDt(XMLGregorianCalendarUtils.now());

return h;
}

/**
* Convenient method to create a new legacy SWIFT header, initialized from simple parameters.
*
Expand Down

0 comments on commit da3a256

Please sign in to comment.