All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.tvd12.ezymq.mosquitto.util.EzyMqttMessages Maven / Gradle / Ivy

The newest version!
package com.tvd12.ezymq.mosquitto.util;

import com.tvd12.ezymq.mosquitto.message.EzyMqttMqMessage;

public final class EzyMqttMessages {

    private EzyMqttMessages() {}

    public static EzyMqttMqMessage toMqttMqMessage(
        EzyMosquittoProperties properties,
        byte[] body
    ) {
        return EzyMqttMqMessage.builder()
            .id(properties.getMessageId())
            .type(properties.getMessageType())
            .correlationId(properties.correlationId)
            .headers(properties.getHeaders())
            .body(body)
            .qos(properties.getQos())
            .retained(properties.isRetained())
            .build();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy