Преглед на файлове

add tostring to bankaccount

Grega Bremec преди 7 месеца
родител
ревизия
7eda2bcc98
променени са 1 файла, в които са добавени 4 реда и са изтрити 1 реда
  1. 4 1
      payments-producer/src/main/java/com/redhat/training/kafka/model/BankAccount.java

+ 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);
+    }
 }