public BillViewObject(Bill bill) { this.billId = bill.getBillId(); this.billOwner = bill.getBillOwner().getUserrId(); this.associatedGroup = bill.getAssociatedGroup().getGroupId(); for (Map.Entry<User, Double> contributor : bill.getContributorMap().entrySet()) { this.contributorMap.put(contributor.getKey().getUserrId(), contributor.getValue()); } for (Map.Entry<User, Double> consumer : bill.getConsumerMap().entrySet()) { this.consumerMap.put(consumer.getKey().getUserrId(), consumer.getValue()); } }