Example #1
0
  @Transactional
  public long sumeCoinsAsValue(User user) {
    long sum = 0;

    for (Coin coin : user.getCoins()) {
      sum += coin.getValue();
    }
    return sum;
  }
Example #2
0
 @Transactional
 public void transferFoundCost(User peerUser) {
   peerUser.getCoins().add(new Coin(Coin.VALUE_FOUND));
 }
Example #3
0
 public List<Coin> allCoins(User user) {
   return user.getCoins();
 }
Example #4
0
 @Transactional
 public void transferSearchCost(User user) {
   user.getCoins().add(new Coin(Coin.VALUE_SEARCH));
 }