/*
 * Copyright 2008 Web Cohesion
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.webcohesion.ofx4j.domain.data.common;

import com.webcohesion.ofx4j.meta.Aggregate;
import com.webcohesion.ofx4j.meta.Element;

import java.util.Date;

/**
 * @author Ryan Heaton
 */
@Aggregate
public class BalanceInfo {

  private double amount;
  private Date asOfDate;

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

  /**
   * The amount.
   *
   * @param amount The amount.
   */
  public void setAmount(double amount) {
    this.amount = amount;
  }

  /**
   * The as-of date.
   *
   * @return The as-of date.
   */
  @Element ( name = "DTASOF", required = true, order = 10)
  public Date getAsOfDate() {
    return asOfDate;
  }

  /**
   * The as-of date.
   *
   * @param asOfDate The as-of date.
   */
  public void setAsOfDate(Date asOfDate) {
    this.asOfDate = asOfDate;
  }
}

@@ -728,16 +728,45 @@
 ement;%0A%0A
+import java.math.BigDecimal;%0A
 import j
@@ -861,29 +861,51 @@
 private 
-double amount
+BigDecimal amount = BigDecimal.ZERO
 ;%0A  priv
@@ -987,66 +987,8 @@
  */%0A
-  @Element ( name = %22BALAMT%22, required = true, order = 0)%0A
   pu
@@ -1026,24 +1026,38 @@
 eturn amount
+.doubleValue()
 ;%0A  %7D%0A%0A  /**
@@ -1174,16 +1174,410 @@
 amount =
+ BigDecimal.valueOf(amount);%0A  %7D%0A  %0A  /**%0A   * The amount.%0A   *%0A   * @param amount The amount.%0A   */%0A  public void setBigDecimalAmount(BigDecimal amount) %7B%0A    this.amount = amount == null? BigDecimal.ZERO : amount;%0A  %7D%0A  %0A  /**%0A   * The amount.%0A   *%0A   * @return The amount.%0A   */%0A  @Element ( name = %22BALAMT%22, required = true, order = 0)%0A  public BigDecimal getBigDecimalAmount() %7B%0A    return
  amount;

Add BigDecimal amount to BalanceInfo