Skip to content

Commit

Permalink
deprecating some cmf Additional Amount classes
Browse files Browse the repository at this point in the history
  • Loading branch information
barspi committed Sep 29, 2023
1 parent 87012c3 commit cc05d30
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
20 changes: 10 additions & 10 deletions modules/cmf/src/main/java/org/jpos/cmf/AdditionalAmount.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
import java.math.BigDecimal;
import java.util.Objects;

/**
* @deprecated Use {@link org.jpos.cmf.CMFAdditionalAmount}
*/
@Deprecated
@SuppressWarnings("WeakerAccess")
public class AdditionalAmount {

Expand Down Expand Up @@ -111,16 +115,12 @@ public String serialize() {

long absAmt= getAmount().movePointRight(getCurrencyMinorUnit()).abs().longValue();

@SuppressWarnings("StringBufferReplaceableByString")
StringBuilder sb = new StringBuilder();
sb.append(getAccountType());
sb.append(getAmountType().toString());
sb.append(getCurrencyCode());
sb.append(getCurrencyMinorUnit());
sb.append(getAmount().compareTo(BigDecimal.ZERO) >= 0 ? "C" : "D");
sb.append(StringUtils.leftPad(Long.toString(absAmt), 12, '0'));

return sb.toString();
return getAccountType() +
getAmountType().toString() +
getCurrencyCode() +
getCurrencyMinorUnit() +
(getAmount().compareTo(BigDecimal.ZERO) >= 0 ? "C" : "D") +
StringUtils.leftPad(Long.toString(absAmt), 12, '0');
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@

/**
* Handles additional amounts field content - DE-054
*
* @deprecated Use {@link org.jpos.iso.AdditionalAmountsWrapper}
*/
@Deprecated
public final class AdditionalAmountsWrapper extends LinkedHashSet<AdditionalAmount> {

private static final long serialVersionUID = 2526355280704001241L;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

import static org.junit.jupiter.api.Assertions.*;


@Deprecated
public final class AdditionalAmountsWrapperTest {

@Test
Expand Down

0 comments on commit cc05d30

Please sign in to comment.