Newer
Older
package ufrn.imd.service.impl;
import ufrn.imd.domain.Account;
import java.rmi.RemoteException;
import java.util.Optional;
import ufrn.imd.service.*;
import ufrn.imd.utils.Log;
public class BalanceServiceImpl implements BalanceService {
@Override
public void balance(Optional<Account> accOP) throws RemoteException {
Account account = accOP.orElseThrow(() -> new RuntimeException("Invalid account"));
Log.info(
BalanceServiceImpl.class,
String.format("Account Balance: R$ %f", account.getBalance())
);
}