Java tutorial
/** * Copyright (C) 2010 Cubeia Ltd <info@cubeia.com> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ package com.cubeia.backoffice.wallet.api.dto.report; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; import org.apache.commons.lang.builder.ToStringBuilder; import org.apache.commons.lang.builder.ToStringStyle; import com.cubeia.backoffice.accounting.api.Money; /** * <p>Cubeia Wallet Protocol Unit implementation.</p> * * <p>This bean is mapped to the XML specification by using JAXB * annotation framework.</p> * * @author Fredrik Johansson, Cubeia Ltd */ @XmlRootElement(name = "ReportEntry") public class TransactionEntry { private Long accountId; private Money amount; public TransactionEntry() { } public TransactionEntry(long accountId, Money amount) { this.accountId = accountId; this.amount = amount; } @XmlElement(name = "accountId") public Long getAccountId() { return accountId; } public void setAccountId(Long sessionId) { this.accountId = sessionId; } @XmlElement(name = "amount") public Money getAmount() { return amount; } public void setAmount(Money amount) { this.amount = amount; } /** * @return String, a readable representation */ @Override public String toString() { return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE); } }