Skip to content

Commit

Permalink
Merge pull request #87 from Julius278/feature/619
Browse files Browse the repository at this point in the history
SDC-618, new SettlementGenerator build for building the object instea…
  • Loading branch information
Julius278 authored Sep 2, 2024
2 parents af91da3 + b653e42 commit b4d92e0
Showing 1 changed file with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,26 @@ public SettlementGenerator settlementValueNext(BigDecimal settlementValueNext){
return this;
}

public Settlement buildObject(){
String settlementString = SDCXMLParser.marshalClassToXMLString(settlement);
if(allFieldsSet(settlement))
return settlement;
else{
logger.error("buildObject: missing input for settlement, settlement string so far: {}", settlementString);
throw new SDCException(ExceptionId.SDC_WRONG_INPUT, "settlement input incomplete", 400);
}
}

/**
*
* @return settlement xml String
*/
public String build(){
String settlementString = SDCXMLParser.marshalClassToXMLString(settlement);
if(allFieldsSet(settlement))
return settlementString;
else{
logger.error("missing input for settlement, settlement string so far: {}", settlementString);
logger.error("buildString: missing input for settlement, settlement string so far: {}", settlementString);
throw new SDCException(ExceptionId.SDC_WRONG_INPUT, "settlement input incomplete", 400);
}
}
Expand Down

0 comments on commit b4d92e0

Please sign in to comment.