Refactor arithmetic operations in EconomicEntityData to be more in-line with Transaction

This commit is contained in:
Allink 2023-05-20 06:11:24 +01:00
parent cb208c710f
commit 7817b0770c
No known key found for this signature in database
2 changed files with 6 additions and 6 deletions

View File

@ -220,15 +220,15 @@ public class SimpleUserData implements UserData
}
@Override
public void addToBalance(long amount)
public long addToBalance(long amount)
{
balance.addAndGet(amount);
return balance.addAndGet(amount);
}
@Override
public void removeFromBalance(long amount)
public long removeFromBalance(long amount)
{
balance.addAndGet(-amount);
return balance.addAndGet(-amount);
}
@Override

View File

@ -6,9 +6,9 @@ public interface EconomicEntityData
long getBalance();
void addToBalance(final long amount);
long addToBalance(final long amount);
void removeFromBalance(final long amount);
long removeFromBalance(final long amount);
void setBalance(final long newBalance);
}