This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.google.gson.Gson; | |
public class App { | |
public static void main(String[] args) { | |
Gson gson = new Gson(); | |
String json = "{\"type\":\"bankaccount\",\"payload\":{\"bankAccountNo\":\"BE123\"}}"; | |
// String json = "{\"type\":\"newuser\",\"payload\":{\"firstName\":\"Sam\",\"lastName\":\"Wolfs\"}}"; | |
Message msg = gson.fromJson(json, Message.class); | |
switch (msg.getType()) { | |
case "bankaccount": |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// prs/delegate.go | |
package prs | |
import ( | |
"github.com/charmbracelet/bubbles/key" | |
"github.com/charmbracelet/bubbles/list" | |
tea "github.com/charmbracelet/bubbletea" | |
) | |
func newItemDelegate(keys *delegateKeyMap) list.DefaultDelegate { |