Browse Source

add tostring to bankaccount

Grega Bremec 7 months ago
parent
commit
7eda2bcc98

+ 4 - 1
payments-producer/src/main/java/com/redhat/training/kafka/model/BankAccount.java

@@ -35,5 +35,8 @@ public class BankAccount {
     public void setCustomerId(String customerId) {
         this.customerId = customerId;
     }
-    
+    public String toString() {
+        return String.format("{\"accountId\": \"%s\", \"customerId\": \"%s\", \"customerName\": \"%s\", \"balance\": %d}",
+                                this.accountNumber, this.customerId, this.customerName, this.balance);
+    }
 }