FreedomNetworkSuite/Fossil/src/main/java/fns/fossil/economy/SimpleMutableTransaction.java
2023-08-01 22:34:18 -05:00

31 lines
748 B
Java

package fns.fossil.economy;
import fns.patchwork.economy.EconomicEntity;
import fns.patchwork.economy.MutableTransaction;
public class SimpleMutableTransaction extends SimpleTransaction implements MutableTransaction
{
public SimpleMutableTransaction(final EconomicEntity source, final EconomicEntity destination, final long balance)
{
super(source, destination, balance);
}
@Override
public long addToBalance(final long amount)
{
return balance.addAndGet(amount);
}
@Override
public long removeFromBalance(final long amount)
{
return this.addToBalance(-amount);
}
@Override
public void setBalance(final long newBalance)
{
balance.set(newBalance);
}
}