Skip to content

Commit

Permalink
Merge pull request #62 from joserobjr/patch-1
Browse files Browse the repository at this point in the history
Add BigDecimal amount to BalanceInfo
  • Loading branch information
stoicflame authored Sep 21, 2021
2 parents 90f89be + c333246 commit 25b5fc3
Showing 1 changed file with 23 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import com.webcohesion.ofx4j.meta.Aggregate;
import com.webcohesion.ofx4j.meta.Element;

import java.math.BigDecimal;
import java.util.Date;

/**
Expand All @@ -27,17 +28,16 @@
@Aggregate
public class BalanceInfo {

private double amount;
private BigDecimal amount = BigDecimal.ZERO;
private Date asOfDate;

/**
* The amount.
*
* @return The amount.
*/
@Element ( name = "BALAMT", required = true, order = 0)
public double getAmount() {
return amount;
return amount.doubleValue();
}

/**
Expand All @@ -46,7 +46,26 @@ public double getAmount() {
* @param amount The amount.
*/
public void setAmount(double amount) {
this.amount = amount;
this.amount = BigDecimal.valueOf(amount);
}

/**
* The amount.
*
* @param amount The amount.
*/
public void setBigDecimalAmount(BigDecimal amount) {
this.amount = amount == null? BigDecimal.ZERO : amount;
}

/**
* The amount.
*
* @return The amount.
*/
@Element ( name = "BALAMT", required = true, order = 0)
public BigDecimal getBigDecimalAmount() {
return amount;
}

/**
Expand Down

0 comments on commit 25b5fc3

Please sign in to comment.