class MqttClientMessage {
        private String type;

        private String typeText;

        private Object data;

        public static MqttClientMessage of(MqttConnection connection) {
            Map<String, Object> data = new HashMap<>();
            data.put("clientId", connection.getClientId());
            data.put("address", connection.getClientAddress().toString());
            connection.getAuth().ifPresent(auth -> {
                data.put("username", auth.getUsername());
                data.put("password", auth.getPassword());
            });
            return MqttClientMessage.of("connection", "连接", data);
        }

        public static MqttClientMessage ofDisconnect(MqttConnection connection) {
            Map<String, Object> data = new HashMap<>();
            data.put("clientId", connection.getClientId());
            data.put("address", connection.getClientAddress().toString());
            connection.getAuth().ifPresent(auth -> {
                data.put("username", auth.getUsername());
                data.put("password", auth.getPassword());
            });
            return MqttClientMessage.of("disconnection", "断开连接", data);
        }

        public static MqttClientMessage of(MqttConnection connection, MqttSubscription subscription) {
            Map<String, Object> data = new HashMap<>();
            data.put("clientId", connection.getClientId());
            data.put("address", connection.getClientAddress().toString());
            data.put("topics", subscription
                .getMessage()
                .topicSubscriptions()
                .stream()
                .map(subs -> "QoS:" + subs.qualityOfService().value() + " Topic:" + subs.topicName())
            );
            return MqttClientMessage.of("subscription", "订阅", data);
        }

        public static MqttClientMessage of(MqttConnection connection, MqttUnSubscription subscription) {<FILL_FUNCTION_BODY>}

        public static MqttClientMessage of(MqttConnection connection, MqttPublishing subscription, PayloadType type) {
            Map<String, Object> data = new HashMap<>();
            data.put("clientId", connection.getClientId());
            data.put("address", connection.getClientAddress().toString());
            data.put("message", MqttMessageResponse.of(subscription.getMessage(), type));
            return MqttClientMessage.of("publish", "推送消息", data);
        }

    }

            Map<String, Object> data = new HashMap<>();
            data.put("clientId", connection.getClientId());
            data.put("address", connection.getClientAddress().toString());
            data.put("topics", subscription
                .getMessage()
                .topics()
            );
            return MqttClientMessage.of("unsubscription", "取消订阅", data);
        
<no_super_class>